used bulk api for both requests(toggle one file or bulk files)
This commit is contained in:
parent
fb3cc7fc5b
commit
f464c5e1fe
@ -88,7 +88,7 @@ export class BulkActionsService {
|
||||
async toggleAutomaticAnalysis(files: File[], excluded?: boolean) {
|
||||
this._loadingService.start();
|
||||
const fileIds = files.map(file => file.fileId);
|
||||
await firstValueFrom(this._reanalysisService.toggleAutomaticAnalysisBulk(files[0].dossierId, fileIds, excluded));
|
||||
await firstValueFrom(this._reanalysisService.toggleAutomaticAnalysis(files[0].dossierId, fileIds, excluded));
|
||||
this._loadingService.stop();
|
||||
}
|
||||
|
||||
|
||||
@ -326,7 +326,7 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
await firstValueFrom(
|
||||
this._reanalysisService.toggleAutomaticAnalysis(
|
||||
this.file.dossierId,
|
||||
this.file.fileId,
|
||||
[this.file.fileId],
|
||||
!this.file.excludedFromAutomaticAnalysis,
|
||||
),
|
||||
);
|
||||
|
||||
@ -53,15 +53,7 @@ export class ReanalysisService extends GenericService<unknown> {
|
||||
}
|
||||
|
||||
@Validate()
|
||||
toggleAutomaticAnalysis(@RequiredParam() dossierId: string, @RequiredParam() fileId: string, excluded?: boolean) {
|
||||
const queryParams: QueryParam[] = [{ key: 'excluded', value: !!excluded }];
|
||||
return this._post({}, `toggle-automatic-analysis/${dossierId}/${fileId}`, queryParams).pipe(
|
||||
switchMap(() => this._filesService.loadAll(dossierId)),
|
||||
);
|
||||
}
|
||||
|
||||
@Validate()
|
||||
toggleAutomaticAnalysisBulk(@RequiredParam() dossierId: string, @RequiredParam() fileIds: string[], excluded?: boolean) {
|
||||
toggleAutomaticAnalysis(@RequiredParam() dossierId: string, @RequiredParam() fileIds: string[], excluded?: boolean) {
|
||||
const queryParams: QueryParam[] = [{ key: 'excluded', value: !!excluded }];
|
||||
return this._post(fileIds, 'toggle-automatic-analysis/bulk', queryParams).pipe(
|
||||
switchMap(() => this._filesService.loadAll(dossierId)),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user