mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:47:07 +00:00
Add exporting of missing shots.
It is enabled by default but the user should pass `missing=t` (or some other truty value) in the query part of the request.
This commit is contained in:
@@ -6,6 +6,7 @@ function transform (events, sequences, opts = {}) {
|
||||
const dgl = !!opts.projectId;
|
||||
const exportQC = opts.exportQC !== false;
|
||||
const exportGeneral = opts.exportGeneral !== false;
|
||||
const exportMissing = opts.exportMissing !== false;
|
||||
|
||||
const output = {
|
||||
DglProjectId: opts.projectId,
|
||||
@@ -272,6 +273,15 @@ function transform (events, sequences, opts = {}) {
|
||||
SequenceObject.Entries.push(lsp);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the missing shots object if not inhibited by the user.
|
||||
if (exportMissing) {
|
||||
// The user also needs to request missing shots from the sequences
|
||||
// endpoint; these are not returned by default.
|
||||
if ("missing_final" in sequence) {
|
||||
SequenceObject.MissingShots = sequence.missing_final.map(s => s.point).sort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
@@ -280,7 +290,7 @@ function transform (events, sequences, opts = {}) {
|
||||
const seis = async function (req, res, next) {
|
||||
try {
|
||||
const events = await event.list(req.params.project, req.query);
|
||||
const sequences = await sequence.list(req.params.project);
|
||||
const sequences = await sequence.list(req.params.project, req.query);
|
||||
const response = transform(events, sequences, {projectId: req.params.project});
|
||||
res.status(200).send(response);
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user