Skip to content

Commit

Permalink
fix: wrong useAsyncData base key
Browse files Browse the repository at this point in the history
  • Loading branch information
sandros94 committed May 30, 2024
1 parent 27f70f9 commit a9491ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime/composables/surreal-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function useSurrealDB(overrides?: Overrides) {
: _record
const _table = toValue(table)
const _key = computed(() => {
return key ?? 'D_' + hash(['surrealItems', toValue(_table), toValue(id || '')])
return key ?? 'Sur_' + hash(['surrealItems', toValue(_table), toValue(id || '')])
})

return useAsyncData<T>(_key.value, () => {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/composables/surreal-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function useSurrealRPC<T = any>(
...opts
} = options
const _key = computed(() => {
return key ?? 'D_' + hash(['surrealItems', req.method, req.params?.toString() ?? ''])
return key ?? 'Sur_' + hash(['useSurrealRPC', req.method, req.params?.toString() ?? ''])
})

return useAsyncData(_key.value, () => $surrealRPC<T>(req, { database, token }), opts)
Expand Down

0 comments on commit a9491ef

Please sign in to comment.