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

Method findById

server/controllers/DataRequestController.js:27–54  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

25 }
26
27 findById(id) {
28 return db.DataRequest.findOne({
29 where: { id },
30 include: [
31 { model: db.Connection, attributes: ["id", "name", "type", "subType", "host"] },
32 {
33 model: db.VariableBinding,
34 on: Sequelize.and(
35 { "$VariableBindings.entity_type$": "DataRequest" },
36 Sequelize.where(
37 Sequelize.cast(Sequelize.col("VariableBindings.entity_id"), "INTEGER"),
38 Sequelize.col("DataRequest.id")
39 )
40 ),
41 required: false
42 }
43 ],
44 })
45 .then((dataRequest) => {
46 if (!dataRequest) {
47 return new Promise((resolve, reject) => reject(new Error(404)));
48 }
49 return new Promise((resolve) => resolve(dataRequest));
50 })
51 .catch((error) => {
52 return new Promise((resolve, reject) => reject(error));
53 });
54 }
55
56 findByChart(chartId) {
57 return db.DataRequest.findOne({

Callers 8

createMethod · 0.95
updateMethod · 0.95
getBuilderMetadataMethod · 0.95
runRequestMethod · 0.95
askAiMethod · 0.95
createVariableBindingMethod · 0.95
updateVariableBindingMethod · 0.95
deleteVariableBindingMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected