fix: update tags

This commit is contained in:
Daniel 2023-03-28 19:07:36 +03:30
parent e41c492675
commit 5328be208b
3 changed files with 2 additions and 3 deletions

View File

@ -27,7 +27,7 @@ export default function ({ onChange, defaultValue }: Props) {
return ( return (
<CreatableSelect <CreatableSelect
isClearable={false} isClearable
onChange={onChange} onChange={onChange}
options={options} options={options}
styles={styles} styles={styles}

View File

@ -39,6 +39,7 @@ export default async function (link: ExtendedLink, userId: number) {
}, },
}, },
tags: { tags: {
set: [],
connectOrCreate: link.tags.map((tag) => ({ connectOrCreate: link.tags.map((tag) => ({
where: { where: {
name_ownerId: { name_ownerId: {

View File

@ -44,8 +44,6 @@ const useLinkStore = create<LinkStore>()((set) => ({
return response.ok; return response.ok;
}, },
updateLink: async (link) => { updateLink: async (link) => {
console.log(link);
const response = await fetch("/api/routes/links", { const response = await fetch("/api/routes/links", {
body: JSON.stringify(link), body: JSON.stringify(link),
headers: { headers: {