MCPcopy Index your code
hub / github.com/chartbrew/chartbrew / findById

Method findById

server/controllers/ChartController.js:143–163  ·  view source on GitHub ↗
(id, customQuery, options = {})

Source from the content-addressed store, hash-verified

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) {

Callers 14

createMethod · 0.95
updateMethod · 0.95
addConnectionMethod · 0.95
updateDatasetsMethod · 0.95
changeDashboardOrderMethod · 0.95
updateChartDataMethod · 0.95
runRequestMethod · 0.95
getChartDataMethod · 0.95
findByShareStringMethod · 0.95
findBySharePolicyMethod · 0.95
takeSnapshotMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected