Let the user set the search path to no survey.

This is so that we can access tables in the `public`
schema which are overloaded by survey tables, as is
the case with `info`.
This commit is contained in:
D. Berge
2021-05-20 18:08:03 +02:00
parent 7917eeeb0b
commit b181e4f424

View File

@@ -32,7 +32,11 @@ async function setSurvey (projectId, client) {
if (!client) {
client = await pool.connect();
}
await client.query("CALL set_survey($1);", [projectId]);
if (projectId) {
await client.query("CALL set_survey($1);", [projectId]);
} else {
await client.query("SET search_path TO public;");
}
return client;
}