(id, customQuery, options = {})
| 141 | } |
| 142 | |
| 143 | findById(id, customQuery, options = {}) { |
| 144 | const query = { |
| 145 | where: { id }, |
| 146 | transaction: options.transaction, |
| 147 | include: [ |
| 148 | { model: db.ChartDatasetConfig, include: [{ model: db.Dataset }] }, |
| 149 | { model: db.Chartshare }, |
| 150 | { model: db.Alert }, |
| 151 | { model: db.SharePolicy }, |
| 152 | ], |
| 153 | order: [[db.ChartDatasetConfig, "order", "ASC"]], |
| 154 | }; |
| 155 | |
| 156 | return db.Chart.findOne(customQuery || query) |
| 157 | .then((chart) => { |
| 158 | return chart; |
| 159 | }) |
| 160 | .catch((error) => { |
| 161 | return new Promise((resolve, reject) => reject(error)); |
| 162 | }); |
| 163 | } |
| 164 | |
| 165 | update(id, data, user, justUpdates) { |
| 166 | if (data.autoUpdate || data.autoUpdate === 0) { |
no outgoing calls
no test coverage detected