refactor: improves repo deletion error handling

This commit is contained in:
Ravinou 2025-04-20 22:53:40 +02:00
commit 56ff17853a
No known key found for this signature in database
GPG key ID: EEEE670C40F6A4D7

View file

@ -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('/');