This commit is contained in:
2026-01-05 13:49:54 +01:00
parent 8bcb35a8f0
commit 58984214fc
7 changed files with 20 additions and 9 deletions
+4 -2
View File
@@ -75,8 +75,10 @@ export default async function checks<
}
if (newQuery?.searchQuery?.join) {
for (let i = 0; i < newQuery.searchQuery.join.length; i++) {
const join = newQuery.searchQuery.join[i];
const alljoins = newQuery?.searchQuery?.join.flat();
for (let i = 0; i < alljoins.length; i++) {
const join = alljoins[i];
if (!join) continue;
@@ -44,7 +44,7 @@ export default function sqlGenerator<
field,
}: {
queryObj: ServerQueryQueryObject[string];
join?: (ServerQueryParamsJoin | undefined)[];
join?: (ServerQueryParamsJoin | ServerQueryParamsJoin[] | undefined)[];
field?: string;
}) {
const finalFieldName = (() => {
@@ -248,6 +248,7 @@ export default function sqlGenerator<
str +=
"," +
genObject.join
.flat()
.filter((j) => !isUndefined(j))
.map((joinObj) => {
const joinTableName = joinObj.alias
@@ -296,6 +297,7 @@ export default function sqlGenerator<
str +=
" " +
genObject.join
.flat()
.filter((j) => !isUndefined(j))
.map((join) => {
return (
+5 -1
View File
@@ -1043,7 +1043,11 @@ export type ServerQueryParam<
addUserId?: {
fieldName: keyof T;
};
join?: (ServerQueryParamsJoin<K> | undefined)[];
join?: (
| ServerQueryParamsJoin<K>
| ServerQueryParamsJoin<K>[]
| undefined
)[];
group?: (keyof T)[];
countSubQueries?: ServerQueryParamsCount[];
fullTextSearch?: ServerQueryParamFullTextSearch<T>;