charles.morrow
01/18/2022, 2:23 PMconst { data, error } = await supabaseClient
.from('treasure_hunt')
.update({
trigger: triggerIds,
})
.eq('uuid', id);
but it doesnt work as expected.
Instead I am just "brute forcing it" by deleting existing links and recreating the new links
await supabaseClient
.from<definitions['trigger_treasure_hunt_link']>(
'trigger_treasure_hunt_link'
)
.delete()
.match({ treasure_hunt_uuid: id });
const { data, error } = await supabaseClient
.from('trigger_treasure_hunt_link')
.insert(
triggerIds.map((trigger) => ({
treasure_hunt_uuid: id,
trigger_uuid: trigger,
}))
);
Is there a smart way to do this like query 1?
Thanksjason-lynx
01/19/2022, 3:17 AM