Skip to content

Commit

Permalink
fix: use correct status code(201) when create new entry on database (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
BertBR authored May 20, 2024
1 parent effeb8e commit 5c6ca79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/partners/partners.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class PartnersController {
async store(@Body() body) {
try {
await this.partnersService.store(body);
return new ServerResponse(200, 'Successfully created partner');
return new ServerResponse(201, 'Successfully created partner');
} catch (err: any) {
this.logger.error(`Failed to create partner: ${err}`);
throw new HttpException(err?.code ?? err?.name ?? `${err}`, 400);
Expand Down

0 comments on commit 5c6ca79

Please sign in to comment.