@@ -19,6 +19,7 @@ import {
1919 type UserResponse ,
2020} from "../../api" ;
2121import { InfoIcon } from "lucide-react" ;
22+ import { createToast } from "../toast" ;
2223
2324const toTitleCase = ( str : string ) => str [ 0 ] . toUpperCase ( ) + str . slice ( 1 ) ;
2425
@@ -52,6 +53,7 @@ export const DeleteDialog = ({
5253 invalidateUsers ( ) ;
5354 break ;
5455 }
56+ createToast ( `${ toTitleCase ( type ) } deleted successfully` , "success" ) ;
5557 } ,
5658 onError : console . error ,
5759 } ) ;
@@ -117,6 +119,7 @@ export const EditProjectEntities = ({ project, trigger }: { project: ProjectResp
117119 mutationFn : api [ "/api/dashboard/project/{project_id}" ] . put ,
118120 onSuccess : ( ) => {
119121 closeRef ?. current ?. click ( ) ;
122+ createToast ( "Entities updated successfully" , "success" ) ;
120123 invalidateProjects ( ) ;
121124 } ,
122125 onError : console . error ,
@@ -184,6 +187,7 @@ export const EditProject = ({ project, trigger }: { project: ProjectResponse; tr
184187 onSuccess : ( ) => {
185188 closeRef ?. current ?. click ( ) ;
186189 queryClient . invalidateQueries ( { queryKey : [ "projects" ] } ) ;
190+ createToast ( "Project updated successfully" , "success" ) ;
187191 } ,
188192 onError : console . error ,
189193 } ) ;
@@ -256,6 +260,7 @@ export const CreateProject = () => {
256260 mutationFn : api [ "/api/dashboard/project/{project_id}" ] . post ,
257261 onSuccess : ( ) => {
258262 closeRef ?. current ?. click ( ) ;
263+ createToast ( "Project created successfully" , "success" ) ;
259264 invalidateProjects ( ) ;
260265 } ,
261266 onError : console . error ,
@@ -337,6 +342,7 @@ export const EditEntity = ({ entity, trigger }: { entity: EntityResponse; trigge
337342 mutationFn : api [ "/api/dashboard/entity/{entity_id}" ] . put ,
338343 onSuccess : ( ) => {
339344 closeRef ?. current ?. click ( ) ;
345+ createToast ( "Entity updated successfully" , "success" ) ;
340346 invalidateEntities ( ) ;
341347 } ,
342348 onError : console . error ,
@@ -422,6 +428,7 @@ export const CreateEntity = () => {
422428 mutationFn : api [ "/api/dashboard/entity" ] . post ,
423429 onSuccess : ( ) => {
424430 closeRef ?. current ?. click ( ) ;
431+ createToast ( "Entity created successfully" , "success" ) ;
425432 invalidateEntities ( ) ;
426433 } ,
427434 onError : console . error ,
@@ -497,6 +504,7 @@ export const EditPassword = ({ user, trigger }: { user: UserResponse; trigger: J
497504 const { mutate, error, reset } = useMutation ( {
498505 mutationFn : api [ "/api/dashboard/user/{username}/password" ] . put ,
499506 onSuccess : ( ) => {
507+ createToast ( "Password updated successfully" , "success" ) ;
500508 closeRef ?. current ?. click ( ) ;
501509 } ,
502510 onError : console . error ,
@@ -564,6 +572,7 @@ export const EditUser = ({ user, trigger }: { user: UserResponse; trigger: JSX.E
564572 mutationFn : api [ "/api/dashboard/user/{username}" ] . put ,
565573 onSuccess : ( ) => {
566574 closeRef ?. current ?. click ( ) ;
575+ createToast ( "User updated successfully" , "success" ) ;
567576 invalidateUsers ( ) ;
568577 } ,
569578 onError : console . error ,
@@ -624,6 +633,7 @@ export const CreateUser = () => {
624633 mutationFn : api [ "/api/dashboard/user" ] . post ,
625634 onSuccess : ( ) => {
626635 closeRef ?. current ?. click ( ) ;
636+ createToast ( "User created successfully" , "success" ) ;
627637 invalidateUsers ( ) ;
628638 } ,
629639 onError : console . error ,
0 commit comments