@xeplr/base-apis 1.0.1 → 1.0.2
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.
- package/README.md +2 -2
- package/lib/genericController.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,8 +9,8 @@ The service layer for a xeplr app: `createApp` wires an Express service, and
|
|
|
9
9
|
1. Install `@xeplr/base-apis` (add `@xeplr/db`, `@xeplr/auth`, `dotenv`).
|
|
10
10
|
2. Create a file env.required.js
|
|
11
11
|
3. For anything
|
|
12
|
-
3. Each API is by default guarded through Auth System. But you will need following variables in your env file for AUTH: AUTH_DB_NAME, AUTH_DB_CONNECTION_INFO_ENCRYPTED,
|
|
13
|
-
4. The
|
|
12
|
+
3. Each API is by default guarded through Auth System. But you will need following variables in your env file for AUTH: AUTH_DB_NAME, AUTH_DB_CONNECTION_INFO_ENCRYPTED, XEPLR_AUTH_MIGRATIONS, AUTH_PORT.
|
|
13
|
+
4. The XEPLR_AUTH_MIGRATIONS is y
|
|
14
14
|
|
|
15
15
|
Example:
|
|
16
16
|
|
package/lib/genericController.js
CHANGED
|
@@ -66,7 +66,7 @@ function sendError(req, res, err) {
|
|
|
66
66
|
*/
|
|
67
67
|
async function save(req, res, hierarchy) {
|
|
68
68
|
var changeSet = req.body;
|
|
69
|
-
|
|
69
|
+
console.log('bruh: ', 1);
|
|
70
70
|
if (!Array.isArray(changeSet) || changeSet.length === 0) {
|
|
71
71
|
return respond(res, HTTP.BAD_REQUEST, STATUS.BAD_REQUEST, 'bad_request', {
|
|
72
72
|
message: 'Expected a non-empty changeset array'
|
|
@@ -102,6 +102,7 @@ async function save(req, res, hierarchy) {
|
|
|
102
102
|
var ids = await processEntry(changeSet[i], rootDef, trx, null, queryContext);
|
|
103
103
|
updatedIds = updatedIds.concat(ids);
|
|
104
104
|
}
|
|
105
|
+
console.log('bruh: ', 2);
|
|
105
106
|
|
|
106
107
|
await trx.commit();
|
|
107
108
|
|
|
@@ -113,6 +114,7 @@ async function save(req, res, hierarchy) {
|
|
|
113
114
|
else console.error('[genericController] afterCommit callback failed:', err.message);
|
|
114
115
|
}
|
|
115
116
|
}
|
|
117
|
+
console.log('bruh: ', 3);
|
|
116
118
|
|
|
117
119
|
respond(res, HTTP.OK, STATUS.UPDATED, 'updated', { updatedIds: updatedIds });
|
|
118
120
|
} catch (err) {
|