File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
backend/plugins/operation_api/src/modules/task Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 ( {
You can’t perform that action at this time.
0 commit comments