Skip to content

Commit

Permalink
feat: added first item composables
Browse files Browse the repository at this point in the history
  • Loading branch information
Intevel committed Mar 23, 2022
1 parent 805dbcc commit 6fb9436
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/runtime/composables/useDirectusItems.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { useDirectus } from "./useDirectus";

export const useDirectusItems = () => {
const directus = useDirectus();

const getItems = async (data: { collection: string }) => {
const items = await directus(`/items/${data}`, {
method: "GET",
});

return items;
};

return { getItems };
};

0 comments on commit 6fb9436

Please sign in to comment.