diff --git a/app/courrier/page.tsx b/app/courrier/page.tsx
index 6b2dcda1..a99506b1 100644
--- a/app/courrier/page.tsx
+++ b/app/courrier/page.tsx
@@ -1296,7 +1296,6 @@ export default function CourrierPage() {
toast({ title: 'Password updated', description: 'Password changed successfully.' });
setShowEditModal(false);
setNewPassword('');
- // Refresh accounts (re-fetch or reload page)
window.location.reload();
} catch (err) {
toast({ title: 'Error', description: err instanceof Error ? err.message : 'Failed to update password', variant: 'destructive' });
@@ -1310,6 +1309,7 @@ export default function CourrierPage() {
setShowEditModal(false)}>Cancel
+ {editLoading ? : 'Save'}
@@ -1322,6 +1322,31 @@ export default function CourrierPage() {
Delete Account
Are you sure you want to delete this account? This action cannot be undone.
+
+
+
+ setShowDeleteDialog(false)}>Cancel
+
+ {
+ if (!accountToDelete) return;
+ setDeleteLoading(true);
+ try {
+ const res = await fetch(`/api/courrier/account?accountId=${accountToDelete.id}`, { method: 'DELETE' });
+ const data = await res.json();
+ if (!res.ok) throw new Error(data.error || 'Failed to delete account');
+ toast({ title: 'Account deleted', description: 'The account was deleted successfully.' });
+ setShowDeleteDialog(false);
+ window.location.reload();
+ } catch (err) {
+ toast({ title: 'Error', description: err instanceof Error ? err.message : 'Failed to delete account', variant: 'destructive' });
+ } finally {
+ setDeleteLoading(false);
+ }
+ }}>Delete
+
+
+
+
>
);
}
\ No newline at end of file