FIX: return null when not found theme

This commit is contained in:
marcos-silva-rodrigues
2025-01-31 13:39:15 -03:00
parent 1102a6e8e5
commit bcfef8359e
+4 -2
View File
@@ -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');