mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
Merge pull request #579 from Hexastack/576-issue---refactor-updateone-logic-to-centralize-logs
update(api): centralize updateOne error handling logic
This commit is contained in:
@@ -174,11 +174,6 @@ export class SubscriberController extends BaseController<
|
||||
@Param('id') id: string,
|
||||
@Body() subscriberUpdate: SubscriberUpdateDto,
|
||||
) {
|
||||
const result = await this.subscriberService.updateOne(id, subscriberUpdate);
|
||||
if (!result) {
|
||||
this.logger.warn(`Unable to update Subscriber by id ${id}`);
|
||||
throw new NotFoundException(`Subscriber with ID ${id} not found`);
|
||||
}
|
||||
return result;
|
||||
return await this.subscriberService.updateOne(id, subscriberUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user