From e17ad6f7836e386931ae6f2e5123c5658b9a7f4a Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Mon, 28 Oct 2024 20:33:40 -0600 Subject: [PATCH] updates --- nextjs/src/hooks/localCourse/storageDirectoryHooks.ts | 11 ++++++----- .../localCourse/storageDirectoryServerActions.ts | 7 +++++++ 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 nextjs/src/hooks/localCourse/storageDirectoryServerActions.ts diff --git a/nextjs/src/hooks/localCourse/storageDirectoryHooks.ts b/nextjs/src/hooks/localCourse/storageDirectoryHooks.ts index 9e7939b..533f7ce 100644 --- a/nextjs/src/hooks/localCourse/storageDirectoryHooks.ts +++ b/nextjs/src/hooks/localCourse/storageDirectoryHooks.ts @@ -8,9 +8,10 @@ export const directoryKeys = { export const useEmptyDirectoriesQuery = () => useSuspenseQuery({ queryKey: directoryKeys.emptyFolders, - queryFn: async () => { - const url = "/api/directories/empty"; - const { data } = await axiosClient.get(url); - return data; - }, + queryFn: getEmptyDirectories + // async () => { + // const url = "/api/directories/empty"; + // const { data } = await axiosClient.get(url); + // return data; + // }, }); diff --git a/nextjs/src/hooks/localCourse/storageDirectoryServerActions.ts b/nextjs/src/hooks/localCourse/storageDirectoryServerActions.ts new file mode 100644 index 0000000..544dbc5 --- /dev/null +++ b/nextjs/src/hooks/localCourse/storageDirectoryServerActions.ts @@ -0,0 +1,7 @@ +"use server" + +import { fileStorageService } from "@/services/fileStorage/fileStorageService" + +export async function getEmptyDirectories() { + return await fileStorageService.getEmptyDirectories() +} \ No newline at end of file