Files
JayuCloud/YumiNail-Admin-Program/api/order.js
T

89 lines
3.0 KiB
JavaScript

/**
* Purpose: request supports order.js by holding or executing the request page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const request = require('../utils/request')
module.exports = {
/**
* Purpose: listOrders supports order.js by holding or executing the list orders page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
listOrders(params) {
return request({
url: '/order/list',
params
})
},
/**
* Purpose: getOrderDetail loads an authoritative admin-scoped order detail row.
* Usage: call with the order id when opening the order detail page so direct page entry works.
*/
getOrderDetail(id) {
return request({
url: `/order/detail/${id}`
})
},
/**
* Purpose: listOrderReviews supports order.js by holding or executing the list order reviews page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
listOrderReviews(orderId) {
return request({
url: `/order/${orderId}/reviews`
})
},
/**
* Purpose: getArtistChangeOptions supports order.js by holding or executing the get artist change options page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
getArtistChangeOptions(orderId, orderItemId) {
return request({
url: `/order/${orderId}/artist-change/options`,
params: {
orderItemId
}
})
},
/**
* Purpose: requestArtistChange supports order.js by holding or executing the request artist change page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
requestArtistChange(data) {
return request({
url: '/order/artist-change/request',
method: 'POST',
data
})
},
/**
* Purpose: listMyPendingArtistChangeRequests supports order.js by holding or executing the list my pending artist change requests page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
listMyPendingArtistChangeRequests() {
return request({
url: '/order/artist-change/my-pending'
})
},
/**
* Purpose: updateOrderStatus supports order.js by holding or executing the update order status page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
updateOrderStatus(id, status) {
return request({
url: `/order/update-status/${id}`,
method: 'PUT',
params: {
status
},
data: {}
})
}
}