Skip to content

Commit 6b12698

Browse files
committed
resolve errors 1 . when try to change task team
2. task project to No project
1 parent 22dd242 commit 6b12698

File tree

2 files changed

+5
-3
lines changed
  • backend/plugins/operation_api/src/modules/task

2 files changed

+5
-3
lines changed

backend/plugins/operation_api/src/modules/task/@types/task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface ITask {
1515
assigneeId?: string;
1616
createdBy?: string;
1717
cycleId?: string | null;
18-
projectId?: string;
18+
projectId?: string | null;
1919
estimatePoint?: number;
2020
userId?: string;
2121
startDate?: Date;

backend/plugins/operation_api/src/modules/task/db/models/Task.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const loadTaskClass = (models: IModels) => {
8484
if (params.projectId) {
8585
query.projectId = params.projectId;
8686
}
87-
87+
8888
if (params.createdAt) {
8989
query.createdAt = { $gte: params.createdAt };
9090
}
@@ -161,6 +161,8 @@ export const loadTaskClass = (models: IModels) => {
161161
}) {
162162
const { _id, ...rest } = doc;
163163

164+
if (rest.projectId === '') rest.projectId = null;
165+
164166
const task = await models.Task.findOne({ _id });
165167

166168
if (!task) {
@@ -216,7 +218,7 @@ export const loadTaskClass = (models: IModels) => {
216218

217219
rest.number = nextNumber;
218220
rest.status = newStatus?._id;
219-
rest.cycleId = '';
221+
rest.cycleId = null;
220222
}
221223

222224
await createActivity({

0 commit comments

Comments
 (0)