@cuboapp/api-backend 1.0.28 → 1.0.29

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +3 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuboapp/api-backend",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Backend Api for CuboApp",
5
5
  "main": "src/index.ts",
6
6
  "repository": "git@github.com:cuboapp/api-backend.git",
package/src/index.ts CHANGED
@@ -137,6 +137,9 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown>
137
137
  ): Promise<CuboCrudGetManyResponse<T[K]>> {
138
138
  opts = opts || {}
139
139
  req = req || {}
140
+
141
+ req.query = cloneDeep(req.query || {})
142
+
140
143
  const entity = await this.getEntity(entityAlias)
141
144
  const augmentation = this.options?.augmentations?.[entityAlias]
142
145
 
@@ -147,7 +150,6 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown>
147
150
  // get all joins
148
151
  const queryDto = await this.helpers.withes.prepare(req, entity, opts)
149
152
  queryDto.withDeleted = opts.queryOptions?.withDeleted
150
- // queryDto.withCrdt = opts.queryOptions?.withCrdt
151
153
 
152
154
  // create find query
153
155
  const regularQuery = await this.helpers.createFindQuery(req, entity, queryDto)
@@ -200,7 +202,6 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown>
200
202
  // get all joins
201
203
  const queryDto = await this.helpers.withes.prepare(req, entity, opts)
202
204
  queryDto.withDeleted = opts.queryOptions?.withDeleted
203
- queryDto.withCrdt = opts.queryOptions?.withCrdt
204
205
  queryDto.limit = 1
205
206
 
206
207
  const query = await this.helpers.createFindQuery(req, entity, queryDto)
@@ -283,13 +284,11 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown>
283
284
  if (!req.query?.id) {
284
285
  throw 'Debounce "updateOne" allowed only with "id"'
285
286
  }
286
- console.log('call debounced updateOne')
287
287
 
288
288
  const key = `${entityAlias}:${+req.query.id}` as `${string}:${number}`
289
289
  let ex = this.debounces.get(key)
290
290
  if (ex) {
291
291
  if (ex.started > +new Date() - opts.debounce) {
292
- console.log('clear execution')
293
292
  Promise.reject(ex.promise)
294
293
  } else {
295
294
  return ex.promise