import { errorHandler, getAuthHeaderOptions, fetchRespHandler, } from "../utils/http"; const API_ENDPOINT = process.env.REACT_APP_UPLOAD_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;