Updates
This commit is contained in:
@@ -77,6 +77,9 @@ 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];
|
||||
|
||||
if (!join) continue;
|
||||
|
||||
const joinTableName = join.tableName;
|
||||
const selectFields = join.selectFields;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { isUndefined } from "lodash";
|
||||
import {
|
||||
ServerQueryParam,
|
||||
ServerQueryParamOrder,
|
||||
@@ -43,7 +44,7 @@ export default function sqlGenerator<
|
||||
field,
|
||||
}: {
|
||||
queryObj: ServerQueryQueryObject[string];
|
||||
join?: ServerQueryParamsJoin[];
|
||||
join?: (ServerQueryParamsJoin | undefined)[];
|
||||
field?: string;
|
||||
}) {
|
||||
const finalFieldName = (() => {
|
||||
@@ -247,6 +248,7 @@ export default function sqlGenerator<
|
||||
str +=
|
||||
"," +
|
||||
genObject.join
|
||||
.filter((j) => !isUndefined(j))
|
||||
.map((joinObj) => {
|
||||
const joinTableName = joinObj.alias
|
||||
? joinObj.alias
|
||||
@@ -294,6 +296,7 @@ export default function sqlGenerator<
|
||||
str +=
|
||||
" " +
|
||||
genObject.join
|
||||
.filter((j) => !isUndefined(j))
|
||||
.map((join) => {
|
||||
return (
|
||||
join.joinType +
|
||||
|
||||
@@ -1043,7 +1043,7 @@ export type ServerQueryParam<
|
||||
addUserId?: {
|
||||
fieldName: keyof T;
|
||||
};
|
||||
join?: ServerQueryParamsJoin<K>[];
|
||||
join?: (ServerQueryParamsJoin<K> | undefined)[];
|
||||
group?: (keyof T)[];
|
||||
countSubQueries?: ServerQueryParamsCount[];
|
||||
fullTextSearch?: ServerQueryParamFullTextSearch<T>;
|
||||
|
||||
Reference in New Issue
Block a user