you can now set description to a link + added link modal + many other changes and improvements
This commit is contained in:
@@ -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 },
|
||||
});
|
||||
|
||||
@@ -31,6 +31,7 @@ export default async function updateLink(
|
||||
},
|
||||
data: {
|
||||
name: link.name,
|
||||
description: link.description,
|
||||
collection: {
|
||||
connectOrCreate: {
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user