refactor: lint fix

This commit is contained in:
ricael
2025-09-08 09:11:45 -03:00
parent 10a2c001ab
commit 79438c9445
4 changed files with 16 additions and 16 deletions

View File

@@ -94,7 +94,7 @@ export class TemplateService {
const version = this.configService.get<WaBusiness>('WA_BUSINESS').VERSION;
urlServer = `${urlServer}/${version}/${this.businessId}/message_templates`;
const headers = { 'Content-Type': 'application/json', Authorization: `Bearer ${this.token}` };
if (method === 'GET') {
const result = await axios.get(urlServer, { headers });
return result.data;
@@ -104,14 +104,14 @@ export class TemplateService {
}
} catch (e) {
this.logger.error('WhatsApp API request error: ' + (e.response?.data || e.message));
// Return the complete error response from WhatsApp API
if (e.response?.data) {
return e.response.data;
}
// If no response data, throw connection error
throw new Error(`Connection error: ${e.message}`);
}
}
}
}