feat(gift): 관리자 선물함 리스트 및 운영 액션 구현
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
const baseUrl = '/api/v2/admin/gifts'
|
||||
|
||||
async function getGifts({ status, applicationNo, nickname, page = 0, size = 20 } = {}) {
|
||||
const params = { page, size }
|
||||
if (status) params.status = status
|
||||
if (applicationNo) params.applicationNo = applicationNo
|
||||
if (nickname) params.nickname = nickname
|
||||
const response = await Vue.axios.get(baseUrl, { params })
|
||||
return response.data
|
||||
}
|
||||
|
||||
async function getGift(applicationNo) {
|
||||
const response = await Vue.axios.get(`${baseUrl}/${encodeURIComponent(applicationNo)}`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
async function arriveMailbox(applicationNo) {
|
||||
const response = await Vue.axios.post(`${baseUrl}/${encodeURIComponent(applicationNo)}/arrive-mailbox`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
async function completeInspection(applicationNo) {
|
||||
const response = await Vue.axios.post(`${baseUrl}/${encodeURIComponent(applicationNo)}/complete-inspection`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
async function completeDelivery(applicationNo) {
|
||||
const response = await Vue.axios.post(`${baseUrl}/${encodeURIComponent(applicationNo)}/complete-delivery`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
async function markUndeliverable(applicationNo, reason) {
|
||||
const response = await Vue.axios.post(`${baseUrl}/${encodeURIComponent(applicationNo)}/mark-undeliverable`, { reason })
|
||||
return response.data
|
||||
}
|
||||
|
||||
export { getGifts, getGift, arriveMailbox, completeInspection, completeDelivery, markUndeliverable }
|
||||
Reference in New Issue
Block a user