Skip to content

Commit

Permalink
Change pass type format from db value (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-walsh22 authored Dec 1, 2023
1 parent 9472fc7 commit f667067
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lambda/smsUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { logger } = require('./logger');


exports.sendSMSMessage = async function (payload, cancellationLink){
payload.type = convertPassType(payload.type);
try {
const gcnSendObj = {
"phone_number": `1${payload.phoneNumber}`,
Expand Down Expand Up @@ -32,4 +33,18 @@ exports.sendSMSMessage = async function (payload, cancellationLink){
logger.error(e)
return sendResponse(400, { msg: 'SMS notification failed.', title: 'Operation Failed' });
}
}
}

function convertPassType(passType) {
const passTimeOptions = ["am", "pm", "all-day"];
switch (passType) {
case "AM":
return passTimeOptions[0];
case "PM":
return passTimeOptions[1];
case "DAY":
return passTimeOptions[2];
default:
return passType;
}
}

0 comments on commit f667067

Please sign in to comment.