Skip to content

Commit

Permalink
fix(clientportal): fix sendSms function
Browse files Browse the repository at this point in the history
  • Loading branch information
soyombo-baterdene committed Jan 25, 2024
1 parent 4105294 commit 686c3fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Expand Up @@ -649,7 +649,9 @@ const clientPortalUserMutations = {

await sendSms(
subdomain,
'messagePro',
config.smsTransporterType
? config.smsTransporterType
: 'messagePro',
clientPortal?.testUserPhone,
body,
);
Expand All @@ -674,7 +676,12 @@ const clientPortalUserMutations = {
config.content.replace(/{.*}/, phoneCode) ||
`Your verification code is ${phoneCode}`;

await sendSms(subdomain, 'messagePro', phone, body);
await sendSms(
subdomain,
config.smsTransporterType ? config.smsTransporterType : 'messagePro',
phone,
body,
);
}

return { userId: user._id, message: 'Sms sent' };
Expand Down Expand Up @@ -889,7 +896,7 @@ const clientPortalUserMutations = {

await sendSms(
subdomain,
config.smsTransporterType,
config.smsTransporterType ? config.smsTransporterType : 'messagePro',
phone,
config.content.replace(/{.*}/, code),
);
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-clientportal-api/src/messageBroker.ts
Expand Up @@ -88,8 +88,8 @@ export const initBroker = async () => {

consumeQueue(
'clientportal:sendSMS',
async ({ subdomain, data: { to, content } }) => {
await sendSms(subdomain, 'messagePro', to, content);
async ({ subdomain, data: { to, content, type } }) => {
await sendSms(subdomain, type, to, content);
},
);

Expand Down

0 comments on commit 686c3fa

Please sign in to comment.