Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import * as URLS from "~/config/urls";
  2. import * as CONFIG from "~/config/config";
  3. import axios from "axios";
  4.  
  5. export const getFranchiseByZip = function(data) {
  6.   const requestData = {
  7.     securityToken: data.securityToken,
  8.     method: "3",
  9.     zipCode: data.zip
  10.   };
  11.   const queryUrl = `${URLS.API_URL}${URLS.FRANCHISE}`;
  12.   return axios.post(queryUrl, encodeURIComponent(JSON.stringify(requestData)), {
  13.     headers: {
  14.       "Content-Type": "application/json"
  15.     }
  16.   });
  17. };
  18.  
  19. export const changeFranchise = function(data) {
  20.   var requestData = {
  21.     securityToken: service.securityToken,
  22.     method: "2",
  23.     franchiseID: data.franchiseID
  24.   };
  25.   const queryUrl = `${URLS.API_URL}${URLS.CHANGE_FRANCHISE}`;
  26.   return axios.post(queryUrl, encodeURIComponent(JSON.stringify(requestData)), {
  27.     headers: {
  28.       "Content-Type": "application/json"
  29.     }
  30.   });
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement