@joystick.js/node-canary 0.0.0-canary.82 → 0.0.0-canary.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,9 +23,10 @@ var postgresql_default = async (settings = {}, databasePort = 2610) => {
|
|
|
23
23
|
});
|
|
24
24
|
return {
|
|
25
25
|
pool,
|
|
26
|
-
query: (...args) => {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
query: async (...args) => {
|
|
27
|
+
const client = await pool.connect();
|
|
28
|
+
const response = await client.query(...args).then((response2) => {
|
|
29
|
+
return response2?.rows || [];
|
|
29
30
|
}).catch((error) => {
|
|
30
31
|
console.log(chalk.redBright(`
|
|
31
32
|
Failed SQL Statement:
|
|
@@ -39,6 +40,8 @@ Failed Values:
|
|
|
39
40
|
console.log(args[1]);
|
|
40
41
|
throw error;
|
|
41
42
|
});
|
|
43
|
+
client.release();
|
|
44
|
+
return response;
|
|
42
45
|
}
|
|
43
46
|
};
|
|
44
47
|
} catch (exception) {
|
package/dist/app/index.js
CHANGED
|
@@ -184,12 +184,14 @@ class App {
|
|
|
184
184
|
const browserSafeRequest = getBrowserSafeRequest(req);
|
|
185
185
|
const data = await getDataFromComponent(componentInstance, apiForDataFunctions, browserSafeRequest);
|
|
186
186
|
const translations = await getTranslations({ build: buildPath, page: req?.query?.pathToComponent }, req);
|
|
187
|
+
const settings = loadSettings();
|
|
187
188
|
return res.status(200).send({
|
|
188
189
|
data: {
|
|
189
190
|
[data?.componentId]: data?.data
|
|
190
191
|
},
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
req: browserSafeRequest,
|
|
193
|
+
settings,
|
|
194
|
+
translations
|
|
193
195
|
});
|
|
194
196
|
}
|
|
195
197
|
res.status(200).send({ data: {}, translations: {} });
|