add sqlite compatibility + fix whitespace bug collections
This commit is contained in:
@@ -66,7 +66,6 @@ export default async function getLink(userId: number, body: string) {
|
||||
query.searchQuery && query.searchFilter?.name
|
||||
? query.searchQuery
|
||||
: undefined,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -75,7 +74,6 @@ export default async function getLink(userId: number, body: string) {
|
||||
query.searchQuery && query.searchFilter?.url
|
||||
? query.searchQuery
|
||||
: undefined,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -84,7 +82,6 @@ export default async function getLink(userId: number, body: string) {
|
||||
query.searchQuery && query.searchFilter?.description
|
||||
? query.searchQuery
|
||||
: undefined,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -100,7 +97,6 @@ export default async function getLink(userId: number, body: string) {
|
||||
query.searchQuery && query.searchFilter?.tags
|
||||
? {
|
||||
contains: query.searchQuery,
|
||||
mode: "insensitive",
|
||||
}
|
||||
: undefined,
|
||||
OR: [
|
||||
@@ -114,7 +110,6 @@ export default async function getLink(userId: number, body: string) {
|
||||
query.searchFilter?.tags
|
||||
? query.searchQuery
|
||||
: undefined,
|
||||
mode: "insensitive",
|
||||
},
|
||||
collection: {
|
||||
members: {
|
||||
|
||||
@@ -20,12 +20,15 @@ export default async function postLink(
|
||||
};
|
||||
}
|
||||
|
||||
link.collection.name = link.collection.name.trim();
|
||||
|
||||
// This has to move above we assign link.collection.name
|
||||
// Because if the link is null (write then delete text on collection)
|
||||
// It will try to do trim on empty string and will throw and error, this prevents it.
|
||||
if (!link.collection.name) {
|
||||
link.collection.name = "Unnamed Collection";
|
||||
}
|
||||
|
||||
link.collection.name = link.collection.name.trim();
|
||||
|
||||
if (link.collection.id) {
|
||||
const collectionIsAccessible = (await getPermission(
|
||||
userId,
|
||||
|
||||
Reference in New Issue
Block a user