deep-foundation / deeplinks

https://discord.gg/deep-foundation
The Unlicense
14 stars 9 forks source link

`deep.update` is not working if a link does not have a value #79

Open FreePhoenix888 opened 1 year ago

FreePhoenix888 commented 1 year ago

Minimal reproduction example:

const {data: [{id: newLinkId}]} = await deep.insert({type_id: 22})
await deep.update(newLinkId, { value: 'abc' }, { table: 'strings' });
await deep.select(newLinkId)

Workaround:

await deep.insert({link_id:876 , value: "name"},{table: "strings"})
await deep.insert({link_id: 877, value: {a: 1}}, {table: "objects"})
Romanxz commented 1 year ago

I've encountered such behaviour and in my case deep.update() does not work even if a link already has value field. image image

FreePhoenix888 commented 1 year ago

I've encountered such behaviour and in my case deep.update() does not work even if a link already has value field. image image

Are you sure your value is in strings table?

Romanxz commented 1 year ago

I don't know much about strings table and other possible tables and how it all functions. Please provide some Info links.