auth flow

This commit is contained in:
arc-alex
2023-11-18 17:53:08 +01:00
parent 31b46bbb34
commit 6b2b6dc6dd
4 changed files with 41 additions and 11 deletions
+12 -5
View File
@@ -232,12 +232,9 @@ export async function postNew(initialData: Partial<ProjectData>) {
* @description sheet Client File
* @return {Promise}
*/
export const uploadSheetClientFile = async (
file: File
) => {
export const uploadSheetClientFile = async (file: File) => {
const formData = new FormData();
formData.append('userFile', file);
await axios
.post(`${ontimeURL}/sheet-clientsecrect`, formData, {
headers: {
@@ -248,4 +245,14 @@ export const uploadSheetClientFile = async (
},
})
.then((response) => response.data.id);
};
};
export const getSheetsAuthStatus = async () => {
const res = await axios.get(`${ontimeURL}/sheet-authstatus`);
return res.data;
};
export const getSheetsAuthUrl = async () => {
const res = await axios.get(`${ontimeURL}/sheet-authurl`);
return res.data;
};