code submit
unknown
typescript
a year ago
1.2 kB
8
Indexable
await this.submitFormData({
code: 'REJECT',
name: this.translate.instant('Từ chối duyệt')
});
await this.submitFormData({
code: 'NEXT',
name: this.translate.instant('Phê duyệt')
});
submitFormData = async (route, cloudToken?) => {
const submitData = {
comment: this.reason || this.currentFormData.comment || '',
action: {
code: route.code,
name: route.name
},
cloudToken,
};
const taskId = (this.formData && this.formData.id) ? this.formData.id : null;
try {
if (this.reason) {
const requestBody = {
entityId: this.ecmNode.id,
entityType: 'ecm_node',
content: this.reason,
mentionIdList: []
};
await this.commentService.addComment(requestBody);
this.reason = '';
}
await this.taskService.completeTask(taskId, submitData);
this.notifySuccess(this.translate.instant('Xử lý thành công'));
} catch (error) {
console.log('submit error: ', error);
this.notifyError(this.translate.instant('Xử lý không được, vui lòng thử lại'));
throw error;
}
}Editor is loading...
Leave a Comment