From 512a5aa49e6cd460d654387763152c151823e233 Mon Sep 17 00:00:00 2001 From: headlessdev Date: Thu, 24 Apr 2025 14:01:19 +0200 Subject: [PATCH] Applications Notifications --- app/dashboard/applications/Applications.tsx | 10 ++++++++++ package-lock.json | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/app/dashboard/applications/Applications.tsx b/app/dashboard/applications/Applications.tsx index 1b55709..0e46c10 100644 --- a/app/dashboard/applications/Applications.tsx +++ b/app/dashboard/applications/Applications.tsx @@ -74,6 +74,8 @@ import { TooltipTrigger, } from "@/components/ui/tooltip" import { StatusIndicator } from "@/components/status-indicator"; +import { Toaster } from "@/components/ui/sonner" +import { toast } from "sonner" interface Application { id: number; @@ -152,8 +154,10 @@ export default function Dashboard() { serverId, }); getApplications(); + toast.success("Application added successfully"); } catch (error: any) { console.log(error.response?.data); + toast.error("Failed to add application"); } }; @@ -170,6 +174,7 @@ export default function Dashboard() { setLoading(false); } catch (error: any) { console.log(error.response?.data); + toast.error("Failed to get applications"); } }; @@ -185,8 +190,10 @@ export default function Dashboard() { try { await axios.post("/api/applications/delete", { id }); getApplications(); + toast.success("Application deleted successfully"); } catch (error: any) { console.log(error.response?.data); + toast.error("Failed to delete application"); } }; @@ -215,8 +222,10 @@ export default function Dashboard() { }); getApplications(); setEditId(null); + toast.success("Application edited successfully"); } catch (error: any) { console.log(error.response.data); + toast.error("Failed to edit application"); } }; @@ -280,6 +289,7 @@ export default function Dashboard() { +
Your Applications diff --git a/package-lock.json b/package-lock.json index a5822e9..8c06500 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5073,6 +5073,21 @@ "optional": true } } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.3.0.tgz", + "integrity": "sha512-vHUQS4YVGJPmpjn7r5lEZuMhK5UQBNBRSB+iGDvJjaNk649pTIcRluDWNb9siunyLLiu/LDPHfvxBtNamyuLTw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } } } }