2019-10-01 11:35:00 +00:00
|
|
|
const common = require('./common')
|
2019-09-15 01:53:38 +00:00
|
|
|
|
|
|
|
exports.createStaff = function(body) {
|
2019-10-01 11:35:00 +00:00
|
|
|
return common.sendRequest({
|
2019-09-15 01:53:38 +00:00
|
|
|
method: 'POST',
|
|
|
|
url: '/api/staff',
|
|
|
|
body: body,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.updateStaff = function(id, body) {
|
2019-10-01 11:35:00 +00:00
|
|
|
return common.sendRequest({
|
2019-09-15 01:53:38 +00:00
|
|
|
method: 'PUT',
|
|
|
|
url: '/api/staff/' + id,
|
|
|
|
body: body,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.getAllStaff = function() {
|
2019-10-01 11:35:00 +00:00
|
|
|
return common.sendRequest({
|
2019-09-15 01:53:38 +00:00
|
|
|
method: 'GET',
|
|
|
|
url: '/api/staff',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.getStaff = function(id) {
|
2019-10-01 11:35:00 +00:00
|
|
|
return common.sendRequest({
|
2019-09-15 01:53:38 +00:00
|
|
|
method: 'GET',
|
|
|
|
url: '/api/staff/' + id,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.removeStaff = function(id) {
|
2019-10-01 11:35:00 +00:00
|
|
|
return common.sendRequest({
|
2019-09-15 01:53:38 +00:00
|
|
|
method: 'DELETE',
|
|
|
|
url: '/api/staff/' + id,
|
|
|
|
})
|
|
|
|
}
|