Chatwoot/app/javascript/survey/api/survey.js
2021-08-23 22:00:47 +05:30

15 lines
486 B
JavaScript

import endPoints from 'survey/api/endPoints';
import { API } from 'survey/helpers/axios';
const getSurveyDetails = async ({ uuid }) => {
const urlData = endPoints.getSurvey({ uuid });
const result = await API.get(urlData.url, { params: urlData.params });
return result;
};
const updateSurvey = async ({ uuid, data }) => {
const urlData = endPoints.updateSurvey({ data, uuid });
await API.put(urlData.url, { ...urlData.data });
};
export { getSurveyDetails, updateSurvey };