From bcfef8359ec757a32c4d7a04ae91384f0c183723 Mon Sep 17 00:00:00 2001 From: marcos-silva-rodrigues Date: Fri, 31 Jan 2025 13:39:15 -0300 Subject: [PATCH] FIX: return null when not found theme --- src/modules/theme/theme.controller.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/theme/theme.controller.ts b/src/modules/theme/theme.controller.ts index e3745ce..327c5be 100644 --- a/src/modules/theme/theme.controller.ts +++ b/src/modules/theme/theme.controller.ts @@ -109,8 +109,10 @@ export class ThemeController { try { const data = await this.themeService.getThemeByCustomer(id); - this.logger.info('Success - getCustomerTheme with id'+ id); - return data; + this.logger.info('Success - getCustomerTheme'+ JSON.stringify(data)); + if (data?.theme) return data; + + return { theme: null }; }catch (err) { if (err.details === ErrorCodes.CUSTOMER.NOT_FOUND) { this.logger.error('Error - getCustomerTheme - Expect CUSTOMER.NOT_FOUND');