From 16d7bc7663c99f73f8f129d60021e6f3ebaec2a4 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Fri, 9 Dec 2022 17:00:07 +0100 Subject: [PATCH] 19691: Passes showErrors param on service layer's create method. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- src/services/collection-service/collection-service.ts | 4 ++-- src/services/common-service/common-resource-service.ts | 4 ++-- src/services/project-service/project-service.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/services/collection-service/collection-service.ts b/src/services/collection-service/collection-service.ts index c1d57802bc..d08e789956 100644 --- a/src/services/collection-service/collection-service.ts +++ b/src/services/collection-service/collection-service.ts @@ -35,8 +35,8 @@ export class CollectionService extends TrashableResourceService) { - return super.create({ ...data, preserveVersion: true }); + create(data?: Partial, showErrors?: boolean) { + return super.create({ ...data, preserveVersion: true }, showErrors); } update(uuid: string, data: Partial, showErrors?: boolean) { diff --git a/src/services/common-service/common-resource-service.ts b/src/services/common-service/common-resource-service.ts index ce66aa37d8..d9be8dae9f 100644 --- a/src/services/common-service/common-resource-service.ts +++ b/src/services/common-service/common-resource-service.ts @@ -26,7 +26,7 @@ export class CommonResourceService extends CommonService ])); } - create(data?: Partial) { + create(data?: Partial, showErrors?: boolean) { let payload: any; if (data !== undefined) { this.readOnlyFields.forEach( field => delete data[field] ); @@ -34,7 +34,7 @@ export class CommonResourceService extends CommonService [this.resourceType.slice(0, -1)]: CommonService.mapKeys(snakeCase)(data), }; } - return super.create(payload); + return super.create(payload, showErrors); } update(uuid: string, data: Partial, showErrors?: boolean, select?: string[]) { diff --git a/src/services/project-service/project-service.ts b/src/services/project-service/project-service.ts index 07b083fdab..442a6ab94f 100644 --- a/src/services/project-service/project-service.ts +++ b/src/services/project-service/project-service.ts @@ -9,9 +9,9 @@ import { ListArguments } from "services/common-service/common-service"; import { FilterBuilder, joinFilters } from "services/api/filter-builder"; export class ProjectService extends GroupsService { - create(data: Partial) { + create(data: Partial, showErrors?: boolean) { const projectData = { ...data, groupClass: GroupClass.PROJECT }; - return super.create(projectData); + return super.create(projectData, showErrors); } list(args: ListArguments = {}) { -- 2.30.2