refactor: project data (#523)

This commit is contained in:
Carlos Valente
2023-09-15 17:33:30 +02:00
committed by GitHub
parent 9708f0bfc6
commit a0c5375376
43 changed files with 207 additions and 193 deletions
@@ -0,0 +1,21 @@
import axios from 'axios';
import { ProjectData } from 'ontime-types';
import { projectDataURL } from './apiConstants';
/**
* @description HTTP request to fetch project data
* @return {Promise}
*/
export async function getProjectData(): Promise<ProjectData> {
const res = await axios.get(projectDataURL);
return res.data;
}
/**
* @description HTTP request to mutate project data
* @return {Promise}
*/
export async function postProjectData(data: ProjectData) {
return axios.post(projectDataURL, data);
}