Browse Source

chore: deprecate multi-tenancy.service methods

pull/6372/head
mehmet-erim 6 years ago
parent
commit
c1ee01c191
  1. 15
      npm/ng-packs/packages/core/src/lib/services/multi-tenancy.service.ts

15
npm/ng-packs/packages/core/src/lib/services/multi-tenancy.service.ts

@ -1,15 +1,18 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { ABP } from '../models/common'; import { ABP } from '../models/common';
import { FindTenantResultDto } from '../models/find-tenant-result-dto'; import {
CurrentTenantDto,
FindTenantResultDto,
} from '../proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models';
import { RestService } from './rest.service'; import { RestService } from './rest.service';
import { SessionStateService } from './session-state.service'; import { SessionStateService } from './session-state.service';
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class MultiTenancyService { export class MultiTenancyService {
private _domainTenant: ABP.BasicItem = null; private _domainTenant: CurrentTenantDto = null;
set domainTenant(value: ABP.BasicItem) { set domainTenant(value: CurrentTenantDto) {
this._domainTenant = value; this._domainTenant = value;
this.sessionState.setTenant(value); this.sessionState.setTenant(value);
} }
@ -24,6 +27,9 @@ export class MultiTenancyService {
constructor(private restService: RestService, private sessionState: SessionStateService) {} constructor(private restService: RestService, private sessionState: SessionStateService) {}
/**
* @deprecated Use AbpTenantService.findTenantByName method instead. To be deleted in v5.0.
*/
findTenantByName(name: string, headers: ABP.Dictionary<string>): Observable<FindTenantResultDto> { findTenantByName(name: string, headers: ABP.Dictionary<string>): Observable<FindTenantResultDto> {
return this.restService.request( return this.restService.request(
{ {
@ -35,6 +41,9 @@ export class MultiTenancyService {
); );
} }
/**
* @deprecated Use AbpTenantService.findTenantById method instead. To be deleted in v5.0.
*/
findTenantById(id: string, headers: ABP.Dictionary<string>): Observable<FindTenantResultDto> { findTenantById(id: string, headers: ABP.Dictionary<string>): Observable<FindTenantResultDto> {
return this.restService.request( return this.restService.request(
{ url: `/api/abp/multi-tenancy/tenants/by-id/${id}`, method: 'GET', headers }, { url: `/api/abp/multi-tenancy/tenants/by-id/${id}`, method: 'GET', headers },

Loading…
Cancel
Save