uncomment code

This commit is contained in:
daniel31x13
2024-03-20 09:56:14 -04:00
parent e5fcf18fa4
commit ede3882a94
3 changed files with 87 additions and 88 deletions
+10 -8
View File
@@ -12,14 +12,16 @@ export default async function postLink(
link: LinkIncludingShortenedCollectionAndTags,
userId: number
) {
try {
new URL(link.url || "");
} catch (error) {
return {
response:
"Please enter a valid Address for the Link. (It should start with http/https)",
status: 400,
};
if (link.url || link.type === "url") {
try {
new URL(link.url || "");
} catch (error) {
return {
response:
"Please enter a valid Address for the Link. (It should start with http/https)",
status: 400,
};
}
}
if (!link.collection.id && link.collection.name) {