@@ -47,10 +47,10 @@ const addDependency = async (data) => {
47
47
if ( dependsOn . length > 500 ) {
48
48
throw new Error ( "Error cannot add more than 500 taskId" ) ;
49
49
}
50
- for ( const dependsId of dependsOn ) {
50
+ for ( const dependency of dependsOn ) {
51
51
const taskDependOn = {
52
- taskId,
53
- dependsId ,
52
+ taskId : taskId ,
53
+ dependsOn : dependency ,
54
54
} ;
55
55
const docid = dependencyModel . doc ( ) ;
56
56
batch . set ( docid , taskDependOn ) ;
@@ -80,8 +80,8 @@ const fetchTasks = async () => {
80
80
const dependencySnapshot = await dependencyModel . where ( "taskId" , "==" , taskId ) . get ( ) ;
81
81
task . dependsOn = [ ] ;
82
82
dependencySnapshot . docs . forEach ( ( doc ) => {
83
- const dependsId = doc . get ( "dependsId " ) ;
84
- task . dependsOn . push ( dependsId ) ;
83
+ const dependency = doc . get ( "dependsOn " ) ;
84
+ task . dependsOn . push ( dependency ) ;
85
85
} ) ;
86
86
return task ;
87
87
} ) ;
@@ -126,8 +126,8 @@ const fetchTask = async (taskId) => {
126
126
const task = await tasksModel . doc ( taskId ) . get ( ) ;
127
127
const dependencySnapshot = await dependencyModel . where ( "taskId" , "==" , taskId ) . get ( ) ;
128
128
const dependencyDocReference = dependencySnapshot . docs . map ( ( doc ) => {
129
- const dependsId = doc . get ( "dependsId " ) ;
130
- return dependsId ;
129
+ const dependency = doc . get ( "dependsOn " ) ;
130
+ return dependency ;
131
131
} ) ;
132
132
const taskData = await fromFirestoreData ( task . data ( ) ) ;
133
133
if ( taskData ?. status ) {
0 commit comments