mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 03:13:47 +00:00
try to forward err to the user
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user