RED-9201 - fixed sorting and search by name
This commit is contained in:
parent
190b040b1a
commit
2eb371fcd6
@ -1,22 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { EntitiesService, QueryParam } from '@iqser/common-ui';
|
||||
import { ComponentMapping, IComponentMapping, IComponentMappingList } from '@red/domain';
|
||||
import { ComponentMapping, ComponentMappingList, IComponentMapping, IComponentMappingList } from '@red/domain';
|
||||
import { Observable } from 'rxjs';
|
||||
import { HeadersConfiguration, List } from '@common-ui/utils';
|
||||
|
||||
interface CreateMappingParams {
|
||||
dossierTemplateId: string;
|
||||
name: string;
|
||||
encoding: string;
|
||||
delimiter: string;
|
||||
}
|
||||
import { List } from '@common-ui/utils';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ComponentMappingsService extends EntitiesService<IComponentMapping, ComponentMapping> {
|
||||
getComponentMappings(dossierTemplateId: string): Observable<IComponentMappingList> {
|
||||
return this._http.get<IComponentMappingList>(`/api/dossier-templates/${dossierTemplateId}/component-mappings`);
|
||||
return this._http
|
||||
.get<IComponentMappingList>(`/api/dossier-templates/${dossierTemplateId}/component-mappings`)
|
||||
.pipe(map(componentMappingList => this.#mapEntities(componentMappingList)));
|
||||
}
|
||||
|
||||
createUpdateComponentMapping(
|
||||
@ -57,4 +53,12 @@ export class ComponentMappingsService extends EntitiesService<IComponentMapping,
|
||||
responseType: 'text',
|
||||
});
|
||||
}
|
||||
|
||||
#mapEntities(componentMappingList: IComponentMappingList) {
|
||||
const componentMappings = componentMappingList.componentMappingList.map(m => new ComponentMapping(m));
|
||||
return new ComponentMappingList({
|
||||
dossierTemplateId: componentMappingList.dossierTemplateId,
|
||||
componentMappingList: componentMappings,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user