@hedhog/blog 0.0.12 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/dist/author/author.controller.d.ts +13 -5
  2. package/dist/author/author.controller.d.ts.map +1 -1
  3. package/dist/author/author.controller.js +7 -7
  4. package/dist/author/author.controller.js.map +1 -1
  5. package/dist/author/author.service.d.ts +9 -1
  6. package/dist/author/author.service.d.ts.map +1 -1
  7. package/dist/author/author.service.js +2 -1
  8. package/dist/author/author.service.js.map +1 -1
  9. package/dist/category/category.controller.d.ts +13 -5
  10. package/dist/category/category.controller.d.ts.map +1 -1
  11. package/dist/category/category.controller.js +9 -9
  12. package/dist/category/category.controller.js.map +1 -1
  13. package/dist/category/category.service.d.ts +9 -1
  14. package/dist/category/category.service.d.ts.map +1 -1
  15. package/dist/category/category.service.js +2 -1
  16. package/dist/category/category.service.js.map +1 -1
  17. package/dist/category/dto/create.dto.d.ts +1 -1
  18. package/dist/category/dto/create.dto.d.ts.map +1 -1
  19. package/dist/category/dto/create.dto.js +2 -2
  20. package/dist/category/dto/create.dto.js.map +1 -1
  21. package/dist/post/post.controller.d.ts +13 -5
  22. package/dist/post/post.controller.d.ts.map +1 -1
  23. package/dist/post/post.controller.js +7 -7
  24. package/dist/post/post.controller.js.map +1 -1
  25. package/dist/post/post.service.d.ts +9 -1
  26. package/dist/post/post.service.d.ts.map +1 -1
  27. package/dist/post/post.service.js +2 -1
  28. package/dist/post/post.service.js.map +1 -1
  29. package/hedhog.yaml +133 -133
  30. package/package.json +9 -5
  31. package/frontend/author/components/author.screen.ts +0 -105
  32. package/frontend/author/components/create-panel.tsx +0 -64
  33. package/frontend/author/components/update-panel.tsx +0 -75
  34. package/frontend/author/react-query/handlers.ts +0 -28
  35. package/frontend/author/react-query/requests.ts +0 -54
  36. package/frontend/category/components/category.screen.ts +0 -105
  37. package/frontend/category/components/create-panel.tsx +0 -53
  38. package/frontend/category/components/update-panel.tsx +0 -64
  39. package/frontend/category/react-query/handlers.ts +0 -28
  40. package/frontend/category/react-query/requests.ts +0 -55
  41. package/frontend/post/components/create-panel.tsx +0 -78
  42. package/frontend/post/components/post.screen.ts +0 -105
  43. package/frontend/post/components/update-panel.tsx +0 -89
  44. package/frontend/post/react-query/handlers.ts +0 -28
  45. package/frontend/post/react-query/requests.ts +0 -54
@@ -1,105 +0,0 @@
1
- import { PageTitle } from "@/components/custom/page-title";
2
- import DataPanel from "@/components/panels/data-panel";
3
- import { useCategoryDelete } from "@/features/blog/category";
4
- import { useApp } from "@/hooks/use-app";
5
- import { isPlural } from "@/lib/utils";
6
- import { Category } from "@/types/models";
7
- import { IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
8
- import { useState } from "react";
9
- import { useTranslation } from "react-i18next";
10
- import CategoryCreatePanel from "./components/category-create-panel";
11
- import CategoryUpdatePanel from "./components/category-update-panel";
12
-
13
- export default function Page() {
14
- const [selectedItems, setSelectedItems] = useState<Category[]>([]);
15
- const { mutate: deleteCategory } = useCategoryDelete();
16
- const { openSheet, confirm, closeSheet } = useApp();
17
- const { t } = useTranslation(["category", "modules", "actions"]);
18
-
19
- const openCreate = () => {
20
- const id = openSheet({
21
- title: t("create", { ns: "actions" }),
22
- description: t("createText", { ns: "category" }),
23
- children: () => <CategoryCreatePanel onCreated={() => closeSheet(id)} />,
24
- });
25
-
26
- return id;
27
- };
28
-
29
- const openDelete = (items: Category[]) => {
30
- return confirm({
31
- title: `${t("delete", { ns: "actions" })} ${items.length} ${isPlural(items.length) ? t("items", { ns: "actions" }) : t("item", { ns: "actions" })}`,
32
- description: t("deleteText", { ns: "category" }),
33
- })
34
- .then(() =>
35
- deleteCategory(
36
- items.map((item) => item.id).filter((id) => id !== undefined),
37
- ),
38
- )
39
- .catch(() => setSelectedItems(items));
40
- };
41
-
42
- const openUpdate = (item: Category) => {
43
- const id = openSheet({
44
- children: () => (
45
- <CategoryUpdatePanel data={item} onUpdated={() => closeSheet(id)} />
46
- ),
47
- title: t("edit", { ns: "category" }),
48
- description: t("editText", { ns: "category" }),
49
- });
50
-
51
- return id;
52
- };
53
-
54
- return (
55
- <>
56
- <PageTitle title={t("category", { ns: "modules" })} />
57
- <DataPanel
58
- url="/category"
59
- layout="table"
60
- id="category"
61
- selectable
62
- columns={[
63
- { key: "id", header: "ID", width: 64 },
64
- { key: "name", header: t("name", { ns: "category" }) },
65
- ]}
66
- selected={selectedItems as Category[]}
67
- multiple
68
- hasSearch
69
- sortable
70
- onItemDoubleClick={(item) => openUpdate(item)}
71
- menuActions={[
72
- {
73
- icon: <IconEdit className="mr-1 w-8 cursor-pointer" />,
74
- label: t("edit", { ns: "actions" }),
75
- tooltip: t("editTooltip", { ns: "category" }),
76
- handler: (items: Category[]) => {
77
- if (items.length === 1) openUpdate(items[0]);
78
- },
79
- show: "once",
80
- },
81
- {
82
- icon: <IconTrash className="mr-1 w-8 cursor-pointer" />,
83
- label: t("delete", { ns: "actions" }),
84
- tooltip: t("deleteTooltip", { ns: "category" }),
85
- variant: "destructive",
86
- handler: (items: Category[]) => {
87
- openDelete(items);
88
- },
89
- show: "some",
90
- },
91
- {
92
- icon: <IconPlus className="mr-1 w-8 cursor-pointer" />,
93
- label: t("create", { ns: "actions" }),
94
- tooltip: t("createTooltip", { ns: "category" }),
95
- variant: "default",
96
- handler: () => {
97
- openCreate();
98
- },
99
- show: "none",
100
- },
101
- ]}
102
- />
103
- </>
104
- );
105
- }
@@ -1,53 +0,0 @@
1
- import FormPanel, {
2
- FormPanelRef,
3
- getFieldsLocale,
4
- } from "@/components/panels/form-panel";
5
-
6
- import { useCategoryCreate } from "@/features/blog/category";
7
- import { Category } from "@/types/models";
8
- import { forwardRef, useImperativeHandle, useRef } from "react";
9
- import { useTranslation } from "react-i18next";
10
-
11
- export type CategoryCreatePanelRef = {
12
- submit: () => void;
13
- };
14
-
15
- export type CategoryCreatePanelProps = {
16
- onCreated?: (data: Category) => void;
17
- };
18
-
19
- const CategoryCreatePanel = forwardRef(
20
- ({ onCreated }: CategoryCreatePanelProps, ref) => {
21
- const formRef = useRef<FormPanelRef>(null);
22
- const { t } = useTranslation(["category", "actions"]);
23
- const { mutateAsync: createCategory } = useCategoryCreate();
24
-
25
- useImperativeHandle(
26
- ref,
27
- () => ({
28
- submit: () => {
29
- formRef.current?.submit();
30
- },
31
- }),
32
- [formRef],
33
- );
34
-
35
- return (
36
- <FormPanel
37
- ref={formRef}
38
- fields={[...getFieldsLocale([{ name: "name" }])]}
39
- button={{ text: t("create", { ns: "actions" }) }}
40
- onSubmit={async (data) => {
41
- const createdData = await createCategory(data);
42
- if (typeof onCreated === "function") {
43
- onCreated(createdData);
44
- }
45
- }}
46
- />
47
- );
48
- },
49
- );
50
-
51
- CategoryCreatePanel.displayName = "CategoryCreatePanel";
52
-
53
- export default CategoryCreatePanel;
@@ -1,64 +0,0 @@
1
- import FormPanel, {
2
- FormPanelRef,
3
- getFieldsLocale,
4
- } from "@/components/panels/form-panel";
5
- import { Overlay } from "@/components/custom/overlay";
6
- import { TabPanel } from "@/components/panels/tab-panel";
7
-
8
- import { useCategoryGet, useCategoryUpdate } from "@/features/blog/category";
9
- import useEffectAfterFirstUpdate from "@/hooks/use-effect-after-first-update";
10
- import { Category } from "@/types/models";
11
- import { forwardRef, useImperativeHandle, useRef } from "react";
12
- import { useTranslation } from "react-i18next";
13
-
14
- export type CategoryUpdatePanelProps = {
15
- data: Category;
16
- onUpdated?: (data: Category) => void;
17
- };
18
-
19
- const CategoryUpdatePanel = forwardRef(
20
- ({ data, onUpdated }: CategoryUpdatePanelProps, ref) => {
21
- const { t } = useTranslation(["person-types", "actions"]);
22
- const { data: item, isLoading } = useCategoryGet(data.id as number);
23
- const { mutate: categoryUpdate } = useCategoryUpdate();
24
- const formRef = useRef<FormPanelRef>(null);
25
-
26
- useEffectAfterFirstUpdate(() => {
27
- if (item && formRef.current) {
28
- formRef.current.setValuesFromItem(item);
29
- }
30
- }, [item]);
31
-
32
- useImperativeHandle(ref, () => ({}));
33
-
34
- return (
35
- <TabPanel
36
- activeTabIndex={0}
37
- tabs={[
38
- {
39
- title: t("details", { ns: "actions" }),
40
- children: (
41
- <Overlay loading={isLoading}>
42
- <FormPanel
43
- ref={formRef}
44
- fields={[...getFieldsLocale([{ name: "name" }])]}
45
- button={{ text: t("save", { ns: "actions" }) }}
46
- onSubmit={(data) => {
47
- categoryUpdate({ id: data.id, data });
48
- if (typeof onUpdated === "function") {
49
- onUpdated(data);
50
- }
51
- }}
52
- />
53
- </Overlay>
54
- ),
55
- },
56
- ]}
57
- />
58
- );
59
- },
60
- );
61
-
62
- CategoryUpdatePanel.displayName = "CategoryUpdatePanel";
63
-
64
- export default CategoryUpdatePanel;
@@ -1,28 +0,0 @@
1
- import { useDefaultMutation } from "@/hooks/use-default-mutation";
2
- import { useQuery } from "@tanstack/react-query";
3
- import { requests } from "./requests";
4
-
5
- const scope = "category";
6
-
7
- export function useCategoryCreate() {
8
- const { categoryCreate } = requests();
9
- return useDefaultMutation(scope, "create", categoryCreate);
10
- }
11
-
12
- export function useCategoryDelete() {
13
- const { categoryDelete } = requests();
14
- return useDefaultMutation(scope, "delete", categoryDelete);
15
- }
16
-
17
- export function useCategoryUpdate() {
18
- const { categoryUpdate } = requests();
19
- return useDefaultMutation(scope, "update", categoryUpdate);
20
- }
21
-
22
- export function useCategoryGet(id: number) {
23
- const { categoryGet } = requests();
24
- return useQuery({
25
- queryKey: [scope, "get"],
26
- queryFn: () => categoryGet(id),
27
- });
28
- }
@@ -1,55 +0,0 @@
1
- import { useApp } from "@/hooks/use-app";
2
- import { Delete, PaginationParams, PaginationResult } from "@/types";
3
- import { Category } from "@/types/models";
4
- import { HttpMethod } from "@/types/http-method";
5
- import { formatDataWithLocale } from "@hedhog/utils";
6
-
7
- export function requests() {
8
- const { request } = useApp();
9
-
10
- const categoryList = async (params: PaginationParams) => {
11
- return request<PaginationResult<Category>>({
12
- url: "/category",
13
- params,
14
- }).then((res) => res.data);
15
- };
16
-
17
- const categoryGet = async (id: number) => {
18
- return request<Category>({
19
- url: `/category/${id}`,
20
- }).then((res) => res.data);
21
- };
22
-
23
- const categoryCreate = async (data: Category) => {
24
- return request<Category>({
25
- url: "/category",
26
- method: HttpMethod.POST,
27
- data: formatDataWithLocale(data),
28
- }).then((res) => res.data);
29
- };
30
-
31
- const categoryDelete = async (ids: number[]) => {
32
- return request<Delete>({
33
- url: "/category",
34
- data: { ids },
35
- method: HttpMethod.DELETE,
36
- }).then((res) => res.data);
37
- };
38
-
39
- const categoryUpdate = async (params: { id: number; data: Category }) => {
40
- const { id, data } = params;
41
- return request<Category>({
42
- url: `/category/${id}`,
43
- method: HttpMethod.PATCH,
44
- data: formatDataWithLocale(data),
45
- }).then((res) => res.data);
46
- };
47
-
48
- return {
49
- categoryCreate,
50
- categoryUpdate,
51
- categoryDelete,
52
- categoryList,
53
- categoryGet,
54
- };
55
- }
@@ -1,78 +0,0 @@
1
- import FormPanel, { FormPanelRef } from "@/components/panels/form-panel";
2
- import { EnumFieldType } from "@/enums/EnumFieldType";
3
- import { usePostCreate } from "@/features/blog/post";
4
- import { Post } from "@/types/models";
5
- import { forwardRef, useImperativeHandle, useRef } from "react";
6
- import { useTranslation } from "react-i18next";
7
-
8
- export type PostCreatePanelRef = {
9
- submit: () => void;
10
- };
11
-
12
- export type PostCreatePanelProps = {
13
- onCreated?: (data: Post) => void;
14
- };
15
-
16
- const PostCreatePanel = forwardRef(
17
- ({ onCreated }: PostCreatePanelProps, ref) => {
18
- const formRef = useRef<FormPanelRef>(null);
19
- const { t } = useTranslation(["post", "actions"]);
20
- const { mutateAsync: createPost } = usePostCreate();
21
-
22
- useImperativeHandle(
23
- ref,
24
- () => ({
25
- submit: () => {
26
- formRef.current?.submit();
27
- },
28
- }),
29
- [formRef],
30
- );
31
-
32
- return (
33
- <FormPanel
34
- ref={formRef}
35
- fields={[
36
- {
37
- name: "title",
38
- label: { text: t("title", { ns: "translation" }) },
39
- type: EnumFieldType.TEXT,
40
- required: true,
41
- },
42
-
43
- {
44
- name: "content",
45
- label: { text: t("content", { ns: "translation" }) },
46
- type: EnumFieldType.TEXT,
47
- required: true,
48
- },
49
-
50
- {
51
- name: "author_id",
52
- label: { text: t("author_id", { ns: "translation" }) },
53
- type: EnumFieldType.TEXT,
54
- required: true,
55
- },
56
-
57
- {
58
- name: "category_id",
59
- label: { text: t("category_id", { ns: "translation" }) },
60
- type: EnumFieldType.TEXT,
61
- required: true,
62
- },
63
- ]}
64
- button={{ text: t("create", { ns: "actions" }) }}
65
- onSubmit={async (data) => {
66
- const createdData = await createPost(data);
67
- if (typeof onCreated === "function") {
68
- onCreated(createdData);
69
- }
70
- }}
71
- />
72
- );
73
- },
74
- );
75
-
76
- PostCreatePanel.displayName = "PostCreatePanel";
77
-
78
- export default PostCreatePanel;
@@ -1,105 +0,0 @@
1
- import { PageTitle } from "@/components/custom/page-title";
2
- import DataPanel from "@/components/panels/data-panel";
3
- import { usePostDelete } from "@/features/blog/post";
4
- import { useApp } from "@/hooks/use-app";
5
- import { isPlural } from "@/lib/utils";
6
- import { Post } from "@/types/models";
7
- import { IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
8
- import { useState } from "react";
9
- import { useTranslation } from "react-i18next";
10
- import PostCreatePanel from "./components/post-create-panel";
11
- import PostUpdatePanel from "./components/post-update-panel";
12
-
13
- export default function Page() {
14
- const [selectedItems, setSelectedItems] = useState<Post[]>([]);
15
- const { mutate: deletePost } = usePostDelete();
16
- const { openSheet, confirm, closeSheet } = useApp();
17
- const { t } = useTranslation(["post", "modules", "actions"]);
18
-
19
- const openCreate = () => {
20
- const id = openSheet({
21
- title: t("create", { ns: "actions" }),
22
- description: t("createText", { ns: "post" }),
23
- children: () => <PostCreatePanel onCreated={() => closeSheet(id)} />,
24
- });
25
-
26
- return id;
27
- };
28
-
29
- const openDelete = (items: Post[]) => {
30
- return confirm({
31
- title: `${t("delete", { ns: "actions" })} ${items.length} ${isPlural(items.length) ? t("items", { ns: "actions" }) : t("item", { ns: "actions" })}`,
32
- description: t("deleteText", { ns: "post" }),
33
- })
34
- .then(() =>
35
- deletePost(
36
- items.map((item) => item.id).filter((id) => id !== undefined),
37
- ),
38
- )
39
- .catch(() => setSelectedItems(items));
40
- };
41
-
42
- const openUpdate = (item: Post) => {
43
- const id = openSheet({
44
- children: () => (
45
- <PostUpdatePanel data={item} onUpdated={() => closeSheet(id)} />
46
- ),
47
- title: t("edit", { ns: "post" }),
48
- description: t("editText", { ns: "post" }),
49
- });
50
-
51
- return id;
52
- };
53
-
54
- return (
55
- <>
56
- <PageTitle title={t("post", { ns: "modules" })} />
57
- <DataPanel
58
- url="/post"
59
- layout="table"
60
- id="post"
61
- selectable
62
- columns={[
63
- { key: "id", header: "ID", width: 64 },
64
- { key: "name", header: t("name", { ns: "post" }) },
65
- ]}
66
- selected={selectedItems as Post[]}
67
- multiple
68
- hasSearch
69
- sortable
70
- onItemDoubleClick={(item) => openUpdate(item)}
71
- menuActions={[
72
- {
73
- icon: <IconEdit className="mr-1 w-8 cursor-pointer" />,
74
- label: t("edit", { ns: "actions" }),
75
- tooltip: t("editTooltip", { ns: "post" }),
76
- handler: (items: Post[]) => {
77
- if (items.length === 1) openUpdate(items[0]);
78
- },
79
- show: "once",
80
- },
81
- {
82
- icon: <IconTrash className="mr-1 w-8 cursor-pointer" />,
83
- label: t("delete", { ns: "actions" }),
84
- tooltip: t("deleteTooltip", { ns: "post" }),
85
- variant: "destructive",
86
- handler: (items: Post[]) => {
87
- openDelete(items);
88
- },
89
- show: "some",
90
- },
91
- {
92
- icon: <IconPlus className="mr-1 w-8 cursor-pointer" />,
93
- label: t("create", { ns: "actions" }),
94
- tooltip: t("createTooltip", { ns: "post" }),
95
- variant: "default",
96
- handler: () => {
97
- openCreate();
98
- },
99
- show: "none",
100
- },
101
- ]}
102
- />
103
- </>
104
- );
105
- }
@@ -1,89 +0,0 @@
1
- import FormPanel, { FormPanelRef } from "@/components/panels/form-panel";
2
- import { Overlay } from "@/components/custom/overlay";
3
- import { TabPanel } from "@/components/panels/tab-panel";
4
- import { EnumFieldType } from "@/enums/EnumFieldType";
5
- import { usePostGet, usePostUpdate } from "@/features/blog/post";
6
- import useEffectAfterFirstUpdate from "@/hooks/use-effect-after-first-update";
7
- import { Post } from "@/types/models";
8
- import { forwardRef, useImperativeHandle, useRef } from "react";
9
- import { useTranslation } from "react-i18next";
10
-
11
- export type PostUpdatePanelProps = {
12
- data: Post;
13
- onUpdated?: (data: Post) => void;
14
- };
15
-
16
- const PostUpdatePanel = forwardRef(
17
- ({ data, onUpdated }: PostUpdatePanelProps, ref) => {
18
- const { t } = useTranslation(["person-types", "actions"]);
19
- const { data: item, isLoading } = usePostGet(data.id as number);
20
- const { mutate: postUpdate } = usePostUpdate();
21
- const formRef = useRef<FormPanelRef>(null);
22
-
23
- useEffectAfterFirstUpdate(() => {
24
- if (item && formRef.current) {
25
- formRef.current.setValuesFromItem(item);
26
- }
27
- }, [item]);
28
-
29
- useImperativeHandle(ref, () => ({}));
30
-
31
- return (
32
- <TabPanel
33
- activeTabIndex={0}
34
- tabs={[
35
- {
36
- title: t("details", { ns: "actions" }),
37
- children: (
38
- <Overlay loading={isLoading}>
39
- <FormPanel
40
- ref={formRef}
41
- fields={[
42
- {
43
- name: "title",
44
- label: { text: t("title", { ns: "translation" }) },
45
- type: EnumFieldType.TEXT,
46
- required: true,
47
- },
48
-
49
- {
50
- name: "content",
51
- label: { text: t("content", { ns: "translation" }) },
52
- type: EnumFieldType.TEXT,
53
- required: true,
54
- },
55
-
56
- {
57
- name: "author_id",
58
- label: { text: t("author_id", { ns: "translation" }) },
59
- type: EnumFieldType.TEXT,
60
- required: true,
61
- },
62
-
63
- {
64
- name: "category_id",
65
- label: { text: t("category_id", { ns: "translation" }) },
66
- type: EnumFieldType.TEXT,
67
- required: true,
68
- },
69
- ]}
70
- button={{ text: t("save", { ns: "actions" }) }}
71
- onSubmit={(data) => {
72
- postUpdate({ id: data.id, data });
73
- if (typeof onUpdated === "function") {
74
- onUpdated(data);
75
- }
76
- }}
77
- />
78
- </Overlay>
79
- ),
80
- },
81
- ]}
82
- />
83
- );
84
- },
85
- );
86
-
87
- PostUpdatePanel.displayName = "PostUpdatePanel";
88
-
89
- export default PostUpdatePanel;
@@ -1,28 +0,0 @@
1
- import { useDefaultMutation } from "@/hooks/use-default-mutation";
2
- import { useQuery } from "@tanstack/react-query";
3
- import { requests } from "./requests";
4
-
5
- const scope = "post";
6
-
7
- export function usePostCreate() {
8
- const { postCreate } = requests();
9
- return useDefaultMutation(scope, "create", postCreate);
10
- }
11
-
12
- export function usePostDelete() {
13
- const { postDelete } = requests();
14
- return useDefaultMutation(scope, "delete", postDelete);
15
- }
16
-
17
- export function usePostUpdate() {
18
- const { postUpdate } = requests();
19
- return useDefaultMutation(scope, "update", postUpdate);
20
- }
21
-
22
- export function usePostGet(id: number) {
23
- const { postGet } = requests();
24
- return useQuery({
25
- queryKey: [scope, "get"],
26
- queryFn: () => postGet(id),
27
- });
28
- }
@@ -1,54 +0,0 @@
1
- import { useApp } from "@/hooks/use-app";
2
- import { Delete, PaginationParams, PaginationResult } from "@/types";
3
- import { Post } from "@/types/models";
4
- import { HttpMethod } from "@/types/http-method";
5
-
6
- export function requests() {
7
- const { request } = useApp();
8
-
9
- const postList = async (params: PaginationParams) => {
10
- return request<PaginationResult<Post>>({
11
- url: "/post",
12
- params,
13
- }).then((res) => res.data);
14
- };
15
-
16
- const postGet = async (id: number) => {
17
- return request<Post>({
18
- url: `/post/${id}`,
19
- }).then((res) => res.data);
20
- };
21
-
22
- const postCreate = async (data: Post) => {
23
- return request<Post>({
24
- url: "/post",
25
- method: HttpMethod.POST,
26
- data: data,
27
- }).then((res) => res.data);
28
- };
29
-
30
- const postDelete = async (ids: number[]) => {
31
- return request<Delete>({
32
- url: "/post",
33
- data: { ids },
34
- method: HttpMethod.DELETE,
35
- }).then((res) => res.data);
36
- };
37
-
38
- const postUpdate = async (params: { id: number; data: Post }) => {
39
- const { id, data } = params;
40
- return request<Post>({
41
- url: `/post/${id}`,
42
- method: HttpMethod.PATCH,
43
- data: data,
44
- }).then((res) => res.data);
45
- };
46
-
47
- return {
48
- postCreate,
49
- postUpdate,
50
- postDelete,
51
- postList,
52
- postGet,
53
- };
54
- }