mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 12:27:07 +00:00
Change db.configuration.get() to use database.
NOTE: this endpoint is redundant with db.project.configuration.get() except for its ability to return a partial tree. TODO: merge this with db.project.configuration.get().
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
const { setSurvey } = require('../connection');
|
||||
const { setSurvey, pool } = require('../connection');
|
||||
|
||||
async function get (projectId, path, opts = {}) {
|
||||
const client = await setSurvey(projectId);
|
||||
|
||||
const text = `
|
||||
SELECT data
|
||||
FROM file_data fd
|
||||
INNER JOIN files f USING (hash)
|
||||
WHERE f.path LIKE '%.yaml';
|
||||
`;
|
||||
|
||||
const res = await client.query(text);
|
||||
client.release();
|
||||
const text = `SELECT meta FROM public.projects WHERE pid = $1;`;
|
||||
const res = await pool.query(text, [projectId]);
|
||||
|
||||
const config = res.rows.length == 1
|
||||
? res.rows[0].data
|
||||
|
||||
Reference in New Issue
Block a user