(id, data)
| 98 | } |
| 99 | |
| 100 | update(id, data) { |
| 101 | const newFields = normalizeProjectScheduleTimezones(data); |
| 102 | return this.findById(id) |
| 103 | .then((project) => { |
| 104 | if (data.passwordProtected && !project.password) { |
| 105 | newFields.password = nanoid(8); |
| 106 | } |
| 107 | return db.Project.update(newFields, { where: { id } }); |
| 108 | }) |
| 109 | .then(() => { |
| 110 | return this.findById(id); |
| 111 | }) |
| 112 | .catch((error) => { |
| 113 | return new Promise((resolve, reject) => reject(error)); |
| 114 | }); |
| 115 | } |
| 116 | |
| 117 | remove(id) { |
| 118 | // remove the project and any associated items alongs with that |
no test coverage detected