gRPC Support (#20)

This commit is contained in:
Gregory Schier
2024-02-09 05:01:00 -08:00
committed by GitHub
parent 219a6b78da
commit 394beb374e
162 changed files with 6670 additions and 1770 deletions

View File

@@ -6,7 +6,7 @@ import type { Folder } from '../lib/models';
import { getFolder } from '../lib/store';
import { useConfirm } from './useConfirm';
import { foldersQueryKey } from './useFolders';
import { requestsQueryKey } from './useRequests';
import { httpRequestsQueryKey } from './useHttpRequests';
export function useDeleteFolder(id: string | null) {
const queryClient = useQueryClient();
@@ -26,7 +26,7 @@ export function useDeleteFolder(id: string | null) {
),
});
if (!confirmed) return null;
return invoke('delete_folder', { folderId: id });
return invoke('cmd_delete_folder', { folderId: id });
},
onSettled: () => trackEvent('Folder', 'Delete'),
onSuccess: async (folder) => {
@@ -36,7 +36,7 @@ export function useDeleteFolder(id: string | null) {
const { workspaceId } = folder;
// Nesting makes it hard to clean things up, so just clear everything that could have been deleted
await queryClient.invalidateQueries(requestsQueryKey({ workspaceId }));
await queryClient.invalidateQueries(httpRequestsQueryKey({ workspaceId }));
await queryClient.invalidateQueries(foldersQueryKey({ workspaceId }));
},
});