@live-change/relations-plugin
Advanced tools
Comparing version 0.9.23 to 0.9.24
{ | ||
"name": "@live-change/relations-plugin", | ||
"version": "0.9.23", | ||
"version": "0.9.24", | ||
"description": "", | ||
@@ -25,6 +25,6 @@ "main": "index.js", | ||
"dependencies": { | ||
"@live-change/framework": "^0.9.23", | ||
"@live-change/framework": "^0.9.24", | ||
"pluralize": "^8.0.0" | ||
}, | ||
"gitHead": "bf65fb9345db4a0fa93ccc827033c766bf52738e" | ||
"gitHead": "491639ed7431a58594e60aedd14fedfb499065a4" | ||
} |
@@ -245,8 +245,9 @@ import App from "@live-change/framework" | ||
const id = obj?.id ?? oldObj?.id | ||
const type = id.slice(0, id.indexOf(':')) | ||
const count = await table.count({ gte: type+':', lte: type+'_\xFF\xFF\xFF\xFF', limit: 1 }) | ||
const typeJson = id.slice(0, id.indexOf(':')) | ||
const type = JSON.parse(typeJson) | ||
const count = await table.count({ gte: typeJson+':', lte: type+'_\xFF\xFF\xFF\xFF', limit: 1 }) | ||
if(count > 0) { | ||
await output.put({ id: JSON.parse(type) }) | ||
await output.put({ id: type }) | ||
} else { | ||
await output.delete({ id: JSON.parse(type) }) | ||
await output.delete({ id: type }) | ||
} | ||
@@ -253,0 +254,0 @@ }) |
148121
3727