29 lines
850 B
JavaScript
29 lines
850 B
JavaScript
import Vue from 'vue';
|
|
|
|
async function saveCategory(title) {
|
|
return Vue.axios.post('/category', {title: title, contentIdList: []});
|
|
}
|
|
|
|
async function modifyCategory(categoryId, title = null, addContentIdList = [], removeContentIdList = []) {
|
|
return Vue.axios.put('/category', {
|
|
categoryId: categoryId,
|
|
title: title,
|
|
addContentIdList: addContentIdList,
|
|
removeContentIdList: removeContentIdList
|
|
});
|
|
}
|
|
|
|
async function deleteCategory(categoryId) {
|
|
return Vue.axios.delete('/category/' + categoryId)
|
|
}
|
|
|
|
async function getCategoryList(creatorId) {
|
|
return Vue.axios.get('/category?creatorId=' + creatorId)
|
|
}
|
|
|
|
async function updateCategoryOrders(ids) {
|
|
return Vue.axios.put('/category/orders', {ids: ids})
|
|
}
|
|
|
|
export {saveCategory, modifyCategory, deleteCategory, getCategoryList, updateCategoryOrders}
|