Skip to content

Commit 024ae1a

Browse files
authored
fix: id field not being mapped (#20)
1 parent d7fcd3a commit 024ae1a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@visualbravo/zenstack-cache",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "Reduce response times and database load with query-level caching integrated with the ZenStack ORM.",
55
"keywords": [
66
"accelerate",

src/plugin.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ export function defineCachePlugin(pluginOptions: CachePluginOptions) {
5959
onQuery: async ({ args, model, operation, proceed, client }) => {
6060
if (args && 'cache' in args) {
6161
const authId = client.$auth
62-
? Object.keys(client.$auth)
63-
.filter(key =>
64-
client.$schema.models[client.$schema.authType!]!.idFields.includes(key),
65-
)
66-
.join('_')
62+
? client.$schema.models[client.$schema.authType!]!.idFields.map(key => client.$auth![key])
6763
: undefined
6864

6965
const json = stableHash({

0 commit comments

Comments
 (0)