feat(gift): 관리자 선물 카테고리 CRUD 추가
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import Vue from 'vue';
|
||||
import { buildGiftCategoryRequest } from '@/utils/gift_category'
|
||||
|
||||
const baseUrl = '/api/v2/admin/gift-categories'
|
||||
|
||||
async function getGiftCategories() {
|
||||
const response = await Vue.axios.get(baseUrl)
|
||||
return response.data
|
||||
}
|
||||
|
||||
async function createGiftCategory(form) {
|
||||
const response = await Vue.axios.post(baseUrl, buildGiftCategoryRequest(form))
|
||||
return response.data
|
||||
}
|
||||
|
||||
async function updateGiftCategory(categoryId, form) {
|
||||
const response = await Vue.axios.put(`${baseUrl}/${encodeURIComponent(categoryId)}`, buildGiftCategoryRequest(form))
|
||||
return response.data
|
||||
}
|
||||
|
||||
async function deactivateGiftCategory(categoryId) {
|
||||
const response = await Vue.axios.delete(`${baseUrl}/${encodeURIComponent(categoryId)}`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export { getGiftCategories, createGiftCategory, updateGiftCategory, deactivateGiftCategory }
|
||||
Reference in New Issue
Block a user