refactor: streamline actionLink resolution in createWhatsAppMessageFromTemplate

This commit is contained in:
Nawaz Dhandala
2025-10-08 14:35:31 +01:00
parent 5d5183b08e
commit 239f2fc34e
3 changed files with 3 additions and 6 deletions

View File

@@ -174,7 +174,7 @@ const formatTeamForSCIM: (
*/
schemas: [
"urn:ietf:params:scim:schemas:core:2.0:Group",
"urn:scim:schemas:core:1.0",
"urn:scim:schemas:core:1.0:meta",
],
id: team.id?.toString(),
displayName: team.name?.toString(),

View File

@@ -382,7 +382,7 @@ export default class WhatsAppService {
(response.jsonData as JSONObject | undefined) || undefined;
// Log full error details for debugging
const errorObject =
const errorObject: JSONObject | undefined =
(responseDataAsJSONObject["error"] as JSONObject | undefined) ||
(responseJsonAsJSONObject?.["error"] as JSONObject | undefined);

View File

@@ -187,10 +187,7 @@ export function createWhatsAppMessageFromTemplate({
);
}
const resolvedActionLink: string = (
actionLink ??
DEFAULT_ACTION_LINK
).trim();
const resolvedActionLink: string = (actionLink ?? DEFAULT_ACTION_LINK).trim();
const templateVariablesWithDefaults: Record<string, string> = {
...(templateVariables ?? {}),