Chatwoot/app/javascript/survey/api/survey.js

16 lines
486 B
JavaScript
Raw Normal View History

2021-08-23 16:30:47 +00:00
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 };