MCPcopy Index your code
hub / github.com/simstudioai/sim / useUpdateFolder

Function useUpdateFolder

apps/sim/hooks/queries/folders.ts:205–220  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203}
204
205export function useUpdateFolder() {
206 const queryClient = useQueryClient()
207
208 return useMutation({
209 mutationFn: async ({ workspaceId, id, updates }: UpdateFolderVariables) => {
210 const { folder } = await requestJson(updateFolderContract, {
211 params: { id },
212 body: updates,
213 })
214 return mapFolder(folder)
215 },
216 onSettled: (_data, _error, variables) => {
217 queryClient.invalidateQueries({ queryKey: folderKeys.list(variables.workspaceId) })
218 },
219 })
220}
221
222export function useDeleteFolderMutation() {
223 const queryClient = useQueryClient()

Callers 1

FolderItemFunction · 0.90

Calls 2

requestJsonFunction · 0.90
mapFolderFunction · 0.70

Tested by

no test coverage detected