try to forward err to the user

This commit is contained in:
arc-alex
2023-12-12 14:37:32 +01:00
parent a7a7a7d886
commit a750c04bad
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -255,13 +255,14 @@ export async function postNew(initialData: Partial<ProjectData>) {
export const uploadSheetClientFile = async (file: File) => {
const formData = new FormData();
formData.append('userFile', file);
await axios
const res = await axios
.post(`${ontimeURL}/sheet-clientsecrect`, formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
})
.then((response) => response.data.id);
return res;
};
export const getSheetsAuthUrl = async () => {
@@ -69,7 +69,9 @@ export default function SheetsModal(props: SheetsModalProps) {
if (!selectedFile) {
return;
} else {
await uploadSheetClientFile(selectedFile);
await uploadSheetClientFile(selectedFile).catch((err) => {
console.error(err); //TODO: how to show this to the user
});
_onChange();
}
};