@dnax/core 0.8.19 → 0.8.20

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/app/hono.ts CHANGED
@@ -431,18 +431,20 @@ function HonoInstance(): typeof app {
431
431
  // udpateOne
432
432
 
433
433
  if (action == "find") {
434
- let key = bentoKey({
434
+ let keyCache = bentoKey({
435
435
  data: body,
436
436
  query: c.req.query,
437
437
  });
438
438
  if (useCache) {
439
- let responseCache = await cache.get(key);
440
- if (responseCache) {
441
- return responseCache;
439
+ let responseFromCache = await cache.get(keyCache);
440
+ if (responseFromCache) {
441
+ response = responseFromCache;
442
442
  } else {
443
443
  response = await rest.find(collection, body?.params || {});
444
- await cache.set(key, response, {
445
- ttl: col?.cache?.ttl || 60,
444
+ await cache.set({
445
+ key: keyCache,
446
+ value: response,
447
+ ttl: col?.cache?.ttl || "1m",
446
448
  });
447
449
  }
448
450
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.8.19",
3
+ "version": "0.8.20",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {
package/types/index.ts CHANGED
@@ -240,7 +240,7 @@ export type Collection = {
240
240
  findOne?: (ctx: ctxApi) => object;
241
241
  };
242
242
  cache: {
243
- ttl?: number;
243
+ ttl?: string;
244
244
  };
245
245
  schema?: object;
246
246
  auth?: {