(task: Partial<Task> & { type: string })
| 100 | static coll = coll; |
| 101 | |
| 102 | static async add(task: Partial<Task> & { type: string }) { |
| 103 | const t: Task = { |
| 104 | ...task, |
| 105 | priority: task.priority ?? 0, |
| 106 | _id: new ObjectId(), |
| 107 | }; |
| 108 | const res = await coll.insertOne(t); |
| 109 | return res.insertedId; |
| 110 | } |
| 111 | |
| 112 | static async addMany(tasks: Task[]) { |
| 113 | const res = await coll.insertMany(tasks); |
no outgoing calls
no test coverage detected