Skip to content

Commit

Permalink
fix: cast doc.name to string
Browse files Browse the repository at this point in the history
  • Loading branch information
netchampfaris committed Jan 1, 2025
1 parent 945c475 commit 6c9aac3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/data-fetching/docStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class DocStore {
if (!doc?.doctype || !doc?.name) {
throw new Error('Invalid doc: must have doctype and name')
}
doc.name = doc.name.toString()
const key = this.getKey(doc.doctype, doc.name)
try {
await idbStore.set(this.storePrefix + key, doc)
Expand Down Expand Up @@ -92,6 +93,7 @@ class DocStore {
const docMap: Record<string, Doc> = {}
for (const doc of docs) {
if (!doc?.doctype || !doc?.name) continue
doc.name = doc.name.toString()
const key = this.getKey(doc.doctype, doc.name)
if (!this.docs.has(key)) {
this.docs.set(key, ref(null))
Expand Down

0 comments on commit 6c9aac3

Please sign in to comment.