mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-13 17:52:38 +02:00
parent
c96be7d9e1
commit
d9e6947fbd
18 changed files with 19 additions and 506 deletions
|
|
@ -5,7 +5,6 @@ import type {
|
|||
DeleteSearchSpaceRequest,
|
||||
UpdateSearchSpaceRequest,
|
||||
} from "@/contracts/types/search-space.types";
|
||||
import { trackSearchSpaceCreated, trackSearchSpaceDeleted } from "@/lib/analytics";
|
||||
import { searchSpacesApiService } from "@/lib/apis/search-spaces-api.service";
|
||||
import { cacheKeys } from "@/lib/query-client/cache-keys";
|
||||
import { queryClient } from "@/lib/query-client/client";
|
||||
|
|
@ -18,10 +17,7 @@ export const createSearchSpaceMutationAtom = atomWithMutation(() => {
|
|||
return searchSpacesApiService.createSearchSpace(request);
|
||||
},
|
||||
|
||||
onSuccess: (data, request: CreateSearchSpaceRequest) => {
|
||||
// Track search space creation
|
||||
trackSearchSpaceCreated({ search_space_id: data.id, name: request.name });
|
||||
|
||||
onSuccess: () => {
|
||||
toast.success("Search space created successfully");
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: cacheKeys.searchSpaces.all,
|
||||
|
|
@ -65,11 +61,6 @@ export const deleteSearchSpaceMutationAtom = atomWithMutation((get) => {
|
|||
},
|
||||
|
||||
onSuccess: (_, request: DeleteSearchSpaceRequest) => {
|
||||
// Track search space deletion
|
||||
if (request.id) {
|
||||
trackSearchSpaceDeleted({ search_space_id: request.id });
|
||||
}
|
||||
|
||||
toast.success("Search space deleted successfully");
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: cacheKeys.searchSpaces.all,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue