(projectId)
| 122 | } |
| 123 | |
| 124 | findByProject(projectId) { |
| 125 | return db.Chart.findAll({ |
| 126 | where: { project_id: projectId }, |
| 127 | order: [["dashboardOrder", "ASC"], [db.ChartDatasetConfig, "order", "ASC"]], |
| 128 | include: [ |
| 129 | { model: db.ChartDatasetConfig, include: [{ model: db.Dataset }] }, |
| 130 | { model: db.Chartshare }, |
| 131 | { model: db.Alert }, |
| 132 | { model: db.SharePolicy, scope: { entity_type: "Chart" } }, |
| 133 | ], |
| 134 | }) |
| 135 | .then((charts) => { |
| 136 | return charts; |
| 137 | }) |
| 138 | .catch((error) => { |
| 139 | return new Promise((resolve, reject) => reject(error)); |
| 140 | }); |
| 141 | } |
| 142 | |
| 143 | findById(id, customQuery, options = {}) { |
| 144 | const query = { |
no test coverage detected