You've already forked isop-mirror
fix: handle errors with status code 400
This commit is contained in:
@@ -31,10 +31,8 @@ async function handleUpdateOfBasicInfo(internship: NewInternship) {
|
|||||||
|
|
||||||
navigateTo("/dashboard/admin/internships");
|
navigateTo("/dashboard/admin/internships");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof FetchError && e.response?.status === 422) {
|
if (e instanceof FetchError && (e.response?.status === 422 || e.response?.status === 400)) {
|
||||||
action_error.value = e.response?._data.message;
|
action_error.value = e.response?._data.message;
|
||||||
} else {
|
|
||||||
action_error.value = "Nepodarilo sa pripojiť na API.";
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user