profile view

This commit is contained in:
2026-04-03 13:40:06 +05:30
parent aa04b105d0
commit 399b2656b8
7 changed files with 95 additions and 5 deletions

View File

@@ -81,9 +81,21 @@ export function useResource<T = any>(config: ResourceConfig) {
},
});
// --- READ ME ---
const useMe = () =>
useQuery({
queryKey: [name, "me"],
queryFn: async () => {
// @ts-ignore
const res = await api.get<T>(`${endpoint}/me`);
return res.data;
},
});
return {
useList,
useRead,
useMe,
useCreate,
useUpdate,
useDelete,