mirror of
https://github.com/Ravinou/borgwarehouse
synced 2026-03-14 22:35:46 +01:00
refactor: ⚡ improves repo deletion error handling
This commit is contained in:
parent
1e4a34edce
commit
56ff17853a
1 changed files with 4 additions and 2 deletions
|
|
@ -86,12 +86,14 @@ export default function RepoManage(props: RepoManageProps) {
|
|||
);
|
||||
router.replace('/');
|
||||
} else {
|
||||
if (response.status == 403)
|
||||
if (response.status == 403) {
|
||||
toast.warning(
|
||||
'🔒 The server is currently protected against repository deletion.',
|
||||
toastOptions
|
||||
);
|
||||
else {
|
||||
setIsLoading(false);
|
||||
router.replace('/');
|
||||
} else {
|
||||
const errorMessage = await response.json();
|
||||
toast.error(`An error has occurred : ${errorMessage.message.stderr}`, toastOptions);
|
||||
router.replace('/');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue