added read-only mode + visual improvements
This commit is contained in:
@@ -30,7 +30,11 @@ export default function DeleteLinkModal({ onClose, activeLink }: Props) {
|
||||
|
||||
toast.dismiss(load);
|
||||
|
||||
response.ok && toast.success(t("deleted"));
|
||||
if (response.ok) {
|
||||
toast.success(t("deleted"));
|
||||
} else {
|
||||
toast.error(response.data as string);
|
||||
}
|
||||
|
||||
if (router.pathname.startsWith("/links/[id]")) {
|
||||
router.push("/dashboard");
|
||||
|
||||
@@ -20,7 +20,11 @@ export default function DeleteUserModal({ onClose, userId }: Props) {
|
||||
|
||||
toast.dismiss(load);
|
||||
|
||||
response.ok && toast.success(t("user_deleted"));
|
||||
if (response.ok) {
|
||||
toast.success(t("user_deleted"));
|
||||
} else {
|
||||
toast.error(response.data as string);
|
||||
}
|
||||
|
||||
onClose();
|
||||
};
|
||||
|
||||
@@ -30,6 +30,8 @@ export default function DeleteTokenModal({ onClose, activeToken }: Props) {
|
||||
|
||||
if (response.ok) {
|
||||
toast.success(t("token_revoked"));
|
||||
} else {
|
||||
toast.error(response.data as string);
|
||||
}
|
||||
|
||||
onClose();
|
||||
|
||||
Reference in New Issue
Block a user