update section
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import axios from "@/config/axios";
|
||||
import type { CreateSectionType, SectionsResponseType } from "../types/Types";
|
||||
import type {
|
||||
CreateSectionType,
|
||||
SectionDetailResponseType,
|
||||
SectionsResponseType,
|
||||
} from "../types/Types";
|
||||
|
||||
export const getSections = async () => {
|
||||
const { data } = await axios.get<SectionsResponseType>(`/admin/section`);
|
||||
@@ -10,3 +14,15 @@ export const createSection = async (params: CreateSectionType) => {
|
||||
const { data } = await axios.post(`/admin/section`, params);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const updateSection = async (id: number, params: CreateSectionType) => {
|
||||
const { data } = await axios.patch(`/admin/section/${id}`, params);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getSectionDetail = async (id: number) => {
|
||||
const { data } = await axios.get<SectionDetailResponseType>(
|
||||
`/admin/section/${id}`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user