Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gschier committed Oct 23, 2024
1 parent debbff8 commit 50b544c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src-web/components/EnvironmentEditDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const EnvironmentEditDialog = function ({ initialEnvironment }: Props) {

const handleCreateEnvironment = async () => {
const e = await createEnvironment.mutateAsync();
if (e == null) return;
setSelectedEnvironmentId(e.id);
};

Expand Down
4 changes: 2 additions & 2 deletions src-web/hooks/useUpdateAnyFolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import {updateModelList} from "./useSyncModelStores";

export function useUpdateAnyFolder() {
const setFolders = useSetAtom(foldersAtom);
return useMutation<void, unknown, { id: string; update: (r: Folder) => Folder }>({
return useMutation<Folder, unknown, { id: string; update: (r: Folder) => Folder }>({
mutationKey: ['update_any_folder'],
mutationFn: async ({ id, update }) => {
const folder = await getFolder(id);
if (folder === null) {
throw new Error("Can't update a null folder");
}

await invokeCmd('cmd_update_folder', { folder: update(folder) });
return invokeCmd<Folder>('cmd_update_folder', { folder: update(folder) });
},
onSuccess: async (folder) => {
setFolders(updateModelList(folder));
Expand Down
4 changes: 2 additions & 2 deletions src-web/hooks/useUpdateWorkspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {workspacesAtom} from "./useWorkspaces";

export function useUpdateWorkspace(id: string | null) {
const setWorkspaces = useSetAtom(workspacesAtom);
return useMutation<void, unknown, Partial<Workspace> | ((w: Workspace) => Workspace)>({
return useMutation<Workspace, unknown, Partial<Workspace> | ((w: Workspace) => Workspace)>({
mutationKey: ['update_workspace', id],
mutationFn: async (v) => {
const workspace = await getWorkspace(id);
Expand All @@ -17,7 +17,7 @@ export function useUpdateWorkspace(id: string | null) {
}

const newWorkspace = typeof v === 'function' ? v(workspace) : { ...workspace, ...v };
await invokeCmd('cmd_update_workspace', { workspace: newWorkspace });
return invokeCmd('cmd_update_workspace', { workspace: newWorkspace });
},
onSuccess: async (workspace) => {
setWorkspaces(updateModelList(workspace));
Expand Down

0 comments on commit 50b544c

Please sign in to comment.