Updates
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user