diff --git a/src/services/antigro-http-client.service.spec.ts b/src/services/antigro-http-client.service.spec.ts index c978933..e75087e 100644 --- a/src/services/antigro-http-client.service.spec.ts +++ b/src/services/antigro-http-client.service.spec.ts @@ -39,7 +39,7 @@ describe('AntigroHttpClientService', () => { // await expect(() => client.getClientDesign('123-123')).rejects.toThrow( - `getClientDesign request failed: Network error`, + `Network error in getClientDesign: Network error`, ); }); @@ -55,7 +55,7 @@ describe('AntigroHttpClientService', () => { // await expect(() => client.getClientDesign('123-123')).rejects.toThrow( - `getClientDesign request failed: Network error`, + `Network error in getClientDesign: Network error`, ); }); @@ -73,7 +73,7 @@ describe('AntigroHttpClientService', () => { //@ts-expect-error await expect(() => client.getClientDesign(payload)).rejects.toThrow( - `Schema validation errored in getClientDesign:`, + `Validation error in getClientDesign:`, ); }); }); @@ -128,7 +128,7 @@ describe('AntigroHttpClientService', () => { // await expect(() => client.createClientDesign(payload)).rejects.toThrow( - `createClientDesign request failed: Network error`, + `Network error in createClientDesign: Network error`, ); }); @@ -150,7 +150,7 @@ describe('AntigroHttpClientService', () => { // await expect(() => client.createClientDesign(payload)).rejects.toThrow( - `createClientDesign request failed: Network error`, + `Network error in createClientDesign: Network error`, ); }); @@ -170,7 +170,7 @@ describe('AntigroHttpClientService', () => { //@ts-expect-error await expect(() => client.createClientDesign(payload)).rejects.toThrow( - `Schema validation errored in createClientDesign:`, + `Validation error in createClientDesign:`, ); }); }); @@ -218,7 +218,7 @@ describe('AntigroHttpClientService', () => { // await expect(() => client.updateClientDesign(payload)).rejects.toThrow( - `updateClientDesign request failed: Network error`, + `Network error in updateClientDesign: Network error`, ); }); @@ -238,7 +238,7 @@ describe('AntigroHttpClientService', () => { // await expect(() => client.updateClientDesign(payload)).rejects.toThrow( - `updateClientDesign request failed: Network error`, + `Network error in updateClientDesign: Network error`, ); }); @@ -256,7 +256,7 @@ describe('AntigroHttpClientService', () => { //@ts-expect-error await expect(() => client.updateClientDesign(payload)).rejects.toThrow( - `Schema validation errored in updateClientDesign:`, + `Validation error in updateClientDesign:`, ); }); }); diff --git a/src/services/antigro-http-client.service.ts b/src/services/antigro-http-client.service.ts index c70b08a..e1f5069 100644 --- a/src/services/antigro-http-client.service.ts +++ b/src/services/antigro-http-client.service.ts @@ -73,9 +73,8 @@ export class AntigroHttpClientService extends HttpClient { data: CreateClientDesignRequest, ): Promise { try { - const { designId } = data; //validate data before sending request. - const safe_data = CreateClientDesignRequestSchema.parse(designId); + const safe_data = CreateClientDesignRequestSchema.parse(data); //call endpoint const response = await this.sendRequest({