perf: 优化子任务读取失败

This commit is contained in:
kuaifan 2024-09-13 05:40:44 +03:00
parent 0d23b973de
commit 050c9702d8
2 changed files with 5 additions and 1 deletions

View File

@ -1278,7 +1278,9 @@ class ProjectTask extends AbstractModel
// 标记已完成
if ($this->parent_id == 0) {
if (self::whereParentId($this->id)->whereCompleteAt(null)->exists()) {
throw new ApiException('子任务未完成');
throw new ApiException('子任务未完成', [
'task_id' => $this->id
], -4004);
}
}
if (!$this->hasOwner()) {

View File

@ -214,6 +214,8 @@ export default {
dispatch("forgetTask", data.task_id)
} else if (ret === -4003) {
dispatch("forgetDialog", data.dialog_id)
} else if (ret === -4004) {
dispatch("getTaskForParent", data.task_id).catch(() => {})
}
}
}