Files
ota-admin-portal/src/services/smsAPI.js
John Wu 2ec340efc5 CEC-3301, CEC-3317 Magna security dll and remote commands (#249)
* CEC-3301, CEC-3317 Magna security dll and remote commands

* Fix test
2022-12-12 10:59:30 -08:00

25 lines
589 B
JavaScript

import {
errorHandler, fetchRespHandler, getAuthHeaderOptions
} from "../utils/http";
const API_ENDPOINT = process.env.REACT_APP_OTA_SERVICE_URL;
const smsAPI = {
/**
* Sends a SMS to an ICCID
* @param {*} data
* @param {*} token
* @returns
*/
send: async (data, token) =>
fetch(`${API_ENDPOINT}/sms`, {
method: "POST",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
body: JSON.stringify(data),
}).then(fetchRespHandler).catch(errorHandler),
};
export default smsAPI;