load and save pages
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import axios from "@/config/axios";
|
||||
import type { CreateCatalogParamsType } from "../types/Types";
|
||||
import type { CatalogResponseType } from "@/pages/catalogue/types/Types";
|
||||
import type {
|
||||
CreateCatalogParamsType,
|
||||
UpdateCatalogParamsType,
|
||||
} from "../types/Types";
|
||||
import type {
|
||||
CatalogByIdResponseType,
|
||||
CatalogResponseType,
|
||||
} from "@/pages/catalogue/types/Types";
|
||||
|
||||
export const createCatalog = async (params: CreateCatalogParamsType) => {
|
||||
const { data } = await axios.post("/catalogue", params);
|
||||
@@ -13,6 +19,13 @@ export const getCatalogs = async () => {
|
||||
};
|
||||
|
||||
export const getCatalogById = async (id: string) => {
|
||||
const { data } = await axios.get(`/catalogue/${id}`);
|
||||
const { data } = await axios.get<CatalogByIdResponseType>(`/catalogue/${id}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const updateCatalog = async (params: UpdateCatalogParamsType) => {
|
||||
const { data } = await axios.patch(`/catalogue/${params.id}`, {
|
||||
content: params.content,
|
||||
});
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user