@cuboapp/api-backend 1.0.17 → 1.0.18
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/package.json +1 -1
- package/src/index.ts +3 -3
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -137,7 +137,7 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>> {
|
|
|
137
137
|
const regularQuery = await this.helpers.createFindQuery(req, entity, queryDto)
|
|
138
138
|
const countQuery = await this.helpers.createFindQuery(req, entity, queryDto, true)
|
|
139
139
|
|
|
140
|
-
const db = await this.helpers.getConnection('
|
|
140
|
+
const db = await this.helpers.getConnection('write')
|
|
141
141
|
|
|
142
142
|
if (opts?.log) {
|
|
143
143
|
console.log(`QUERY:getMany to "${String(entityAlias)}":`, regularQuery.sql, regularQuery.replacements, { req, opts, queryDto })
|
|
@@ -250,7 +250,7 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>> {
|
|
|
250
250
|
response = await augmentation.afterCreate(response, req, opts)
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
if (opts.crdt
|
|
253
|
+
if (opts.crdt === true && this.crdt?.isCrdtSupported(entity)) {
|
|
254
254
|
const state = await this.crdt.createState({ entityAlias, id: created_id, entity }, response)
|
|
255
255
|
|
|
256
256
|
const fieldKey = entity.fields.find((f) => f.type === 'binary').alias
|
|
@@ -302,7 +302,7 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>> {
|
|
|
302
302
|
response = await augmentation.afterUpdate(response, req, opts)
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
if (opts.crdt
|
|
305
|
+
if (opts.crdt === true && this.crdt?.isCrdtSupported(entity)) {
|
|
306
306
|
const context = { auth: opts?.extra?.auth }
|
|
307
307
|
await this.crdt.updateDocument({ entityAlias, id: item.id, entity }, response, context)
|
|
308
308
|
|