RED-9201 - UI for Component Mapping Tables

This commit is contained in:
Valentin Mihai 2024-07-26 12:13:05 +03:00
parent 2b00876e6b
commit 9010677c6d
2 changed files with 3 additions and 2 deletions

View File

@ -63,9 +63,10 @@ export class AddEditComponentMappingDialogComponent
async ngOnInit() {
if (this.data.mapping?.fileName) {
this.activeFile = { name: this.data.mapping.fileName } as File;
const file = await firstValueFrom(
const fileContent = await firstValueFrom(
this._componentMappingService.getComponentMappingFile(this.data.dossierTemplateId, this.data.mapping.id),
);
const file = new Blob([fileContent.body as Blob], { type: 'text/csv' });
this.form.get('file').setValue(file);
this.initialFormValue = this.form.getRawValue();
}

View File

@ -22,7 +22,7 @@ export class ComponentMappingsService extends EntitiesService<IComponentMapping,
file: Blob,
): Observable<IComponentMapping> {
const formParams = new FormData();
formParams.append('file', file);
formParams.append('file', file, `${componentMapping.name}.csv`);
const queryParams: List<QueryParam> = [
{ key: 'name', value: componentMapping.name },