mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: streamline actionLink resolution in createWhatsAppMessageFromTemplate
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 ?? {}),
|
||||
|
||||
Reference in New Issue
Block a user