refactor: change column name
This commit is contained in:
parent
1bc8cf52d5
commit
11459bbd56
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `vn`.`workerTimeControlMail` CHANGE emailResponse reason text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL;
|
|
@ -24,7 +24,7 @@ module.exports = Self => {
|
|||
required: true
|
||||
},
|
||||
{
|
||||
arg: 'emailResponse',
|
||||
arg: 'reason',
|
||||
type: 'string'
|
||||
}],
|
||||
returns: {
|
||||
|
@ -58,13 +58,13 @@ module.exports = Self => {
|
|||
if (!workerTimeControlMail) throw new UserError(`There aren't records for this week`);
|
||||
|
||||
const oldState = workerTimeControlMail.state;
|
||||
const oldEmailResponse = workerTimeControlMail.emailResponse;
|
||||
const oldReason = workerTimeControlMail.reason;
|
||||
|
||||
if (oldState == args.state) throw new UserError('Already has this status');
|
||||
|
||||
await workerTimeControlMail.updateAttributes({
|
||||
state: args.state,
|
||||
emailResponse: args.emailResponse || null
|
||||
reason: args.reason || null
|
||||
}, myOptions);
|
||||
|
||||
const logRecord = {
|
||||
|
@ -74,11 +74,11 @@ module.exports = Self => {
|
|||
changedModel: 'WorkerTimeControlMail',
|
||||
oldInstance: {
|
||||
state: oldState,
|
||||
emailResponse: oldEmailResponse
|
||||
reason: oldReason
|
||||
},
|
||||
newInstance: {
|
||||
state: args.state,
|
||||
emailResponse: args.emailResponse
|
||||
reason: args.reason
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"updated": {
|
||||
"type": "date"
|
||||
},
|
||||
"emailResponse": {
|
||||
"reason": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -322,7 +322,7 @@ class Controller extends Section {
|
|||
year: this.date.getFullYear(),
|
||||
week: weekNumber,
|
||||
state: 'REVISE',
|
||||
emailResponse: this.reason
|
||||
reason: this.reason
|
||||
};
|
||||
const query = `WorkerTimeControls/updateWorkerTimeControlMail`;
|
||||
this.$http.post(query, params).then(() => {
|
||||
|
|
Loading…
Reference in New Issue