You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
569 B
24 lines
569 B
2 years ago
|
'use strict';
|
||
|
const moment = require('moment')
|
||
|
|
||
|
async function appoint(ctx) {
|
||
|
try {
|
||
|
const models = ctx.fs.dc.models
|
||
|
const { recordId, performerId } = ctx.request.body
|
||
|
await models.Report.update({
|
||
|
performerId
|
||
|
}, { where: { id: recordId } })
|
||
|
ctx.status = 204;
|
||
|
} catch (error) {
|
||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
|
||
|
ctx.status = 400;
|
||
|
ctx.body = {
|
||
|
message: typeof error == 'string' ? error : undefined
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
module.exports = {
|
||
|
appoint
|
||
|
};
|