Files
dougal-software/lib/www/server/lib/db/label/list.js
D. Berge a73376572b API: Add label querying endpoint.
Labels can be associated with events and can have
display properties such as a description and colour,
this is why we need an endpoint for the client to
retrieve them.
2020-08-12 11:41:28 +02:00

17 lines
290 B
JavaScript

const { pool } = require('../connection');
async function list (projectId, opts = {}) {
await pool.query("CALL set_survey($1);", [projectId]);
const text = `
SELECT *
FROM labels
ORDER BY name;
`;
const res = await pool.query(text);
return res.rows;
}
module.exports = list;