mirror of
https://github.com/get-drexa/drive.git
synced 2026-02-02 19:31:17 +00:00
fix: pass include=path when creating dir
This commit is contained in:
@@ -88,13 +88,17 @@ export const createDirectoryMutationAtom = atom((get) => {
|
|||||||
return mutationOptions({
|
return mutationOptions({
|
||||||
mutationFn: async (data: { name: string; parentId: string }) => {
|
mutationFn: async (data: { name: string; parentId: string }) => {
|
||||||
if (!account) throw new Error("No account selected")
|
if (!account) throw new Error("No account selected")
|
||||||
return fetchApi("POST", `/accounts/${account.id}/directories`, {
|
return fetchApi(
|
||||||
|
"POST",
|
||||||
|
`/accounts/${account.id}/directories?include=path`,
|
||||||
|
{
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
name: data.name,
|
name: data.name,
|
||||||
parentId: data.parentId,
|
parentId: data.parentId,
|
||||||
}),
|
}),
|
||||||
returns: DirectoryInfoWithPath,
|
returns: DirectoryInfoWithPath,
|
||||||
}).then(([_, result]) => result)
|
},
|
||||||
|
).then(([_, result]) => result)
|
||||||
},
|
},
|
||||||
onSuccess: (data, _variables, _context, { client }) => {
|
onSuccess: (data, _variables, _context, { client }) => {
|
||||||
client.setQueryData(
|
client.setQueryData(
|
||||||
|
|||||||
Reference in New Issue
Block a user