CEC-758 Add SMS send page and result (#173)

* Add SMS send and result pages

* Update snapshot

Co-authored-by: jwu-fisker <jwu@fiskerinc.com>
This commit is contained in:
arpanetus
2022-08-02 01:11:11 +06:00
committed by GitHub
parent b70afa5312
commit 00af90902e
13 changed files with 1307 additions and 72 deletions

27
src/services/smsAPI.js Normal file
View File

@@ -0,0 +1,27 @@
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;