feat(construction): Phase 3.1 카테고리관리 API 연동 완료
- apiClient에 patch 메서드 추가 - apiClient.get에 params 옵션 지원 추가 - updateCategory: PUT → PATCH 수정 - reorderCategories: PUT → POST 수정
This commit is contained in:
@@ -94,7 +94,7 @@ export async function createCategory(data: {
|
||||
|
||||
/**
|
||||
* 카테고리 수정
|
||||
* PUT /api/v1/categories/{id}
|
||||
* PATCH /api/v1/categories/{id}
|
||||
*/
|
||||
export async function updateCategory(
|
||||
id: string,
|
||||
@@ -105,7 +105,7 @@ export async function updateCategory(
|
||||
error?: string;
|
||||
}> {
|
||||
try {
|
||||
const response = await apiClient.put<ApiCategory>(`/categories/${id}`, {
|
||||
const response = await apiClient.patch<ApiCategory>(`/categories/${id}`, {
|
||||
name: data.name,
|
||||
});
|
||||
return { success: true, data: transformCategory(response) };
|
||||
@@ -161,7 +161,7 @@ export async function deleteCategory(id: string): Promise<{
|
||||
|
||||
/**
|
||||
* 카테고리 순서 변경
|
||||
* PUT /api/v1/categories/reorder
|
||||
* POST /api/v1/categories/reorder
|
||||
*/
|
||||
export async function reorderCategories(
|
||||
items: { id: string; sort_order: number }[]
|
||||
@@ -170,7 +170,7 @@ export async function reorderCategories(
|
||||
error?: string;
|
||||
}> {
|
||||
try {
|
||||
await apiClient.put('/categories/reorder', {
|
||||
await apiClient.post('/categories/reorder', {
|
||||
items: items.map((item) => ({
|
||||
id: Number(item.id),
|
||||
sort_order: item.sort_order,
|
||||
|
||||
Reference in New Issue
Block a user