Hello, I have a query which finds an Audit, then some related DetailAudit objects (one-to-many) and this related model has a “relation” column standards (many-to-many).
The DetailAudit objects are passed to a view and in that view I have to get the standards related objects but I don’t know how.
How can I extract the “standards” relation column in my pug view?
This is the function that gets these objects:
function show(id, handler) {
var query = new Parse.Query(Audit);
query.include("auditTest");
query.include("standar");
query.include("category");
query.include("type");
query.include("auditLeader");
query.include("auditTest");
query.include("conclusiones");
query
.get(id)
.then(function (audit) {
var query = new Parse.Query(DetailAudit);
query.equalTo("audit", audit);
query.include("audit");
query.include("auditor");
query.include("standar");
query.include("standards");
query.include("area");
query.include("process");
query.limit(1000);
query.find({
success: function (details) {
audit.details = details;
handler({
status: 200,
msn: "Detalles listadas exitosamente",
audit: audit,
});
},
error: function (error) {
//handle error
},
});
})
.catch(function (error) {
// catch error
});
}
Thanks in advance.