you can now set description to a link + added link modal + many other changes and improvements

This commit is contained in:
Daniel
2023-06-20 18:09:03 +03:30
parent 033f036ef3
commit a9edb4b359
19 changed files with 949 additions and 385 deletions
+5 -2
View File
@@ -34,12 +34,16 @@ export default async function postLink(
link.collection.ownerId = userId;
}
const title = await getTitle(link.url);
const description =
link.description && link.description !== ""
? link.description
: await getTitle(link.url);
const newLink: Link = await prisma.link.create({
data: {
name: link.name,
url: link.url,
description,
collection: {
connectOrCreate: {
where: {
@@ -72,7 +76,6 @@ export default async function postLink(
},
})),
},
description: title,
},
include: { tags: true, collection: true },
});
+1
View File
@@ -31,6 +31,7 @@ export default async function updateLink(
},
data: {
name: link.name,
description: link.description,
collection: {
connectOrCreate: {
where: {