Skip to content

Commit

Permalink
chore: delete useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
caoxing9 committed Nov 21, 2024
1 parent a6425aa commit 298e4b4
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions apps/nestjs-backend/src/db-provider/search-query/abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,39 +172,37 @@ export abstract class SearchQueryAbstract {
searchField: IFieldInstance[],
searchValue: string
) {
const searchQuery = searchField
.map((field) => {
const searchQueryBuilder = new SearchQuery(queryBuilder, field, searchValue);

if (field.isMultipleCellValue) {
switch (field.cellValueType) {
case CellValueType.DateTime:
return searchQueryBuilder.getMultipleDateSqlQuery();
case CellValueType.Number:
return searchQueryBuilder.getMultipleNumberSqlQuery();
case CellValueType.String:
if (field.isStructuredCellValue) {
return searchQueryBuilder.getMultipleJsonSqlQuery();
} else {
return searchQueryBuilder.getMultipleTextSqlQuery();
}
}
}
const searchQuery = searchField.map((field) => {
const searchQueryBuilder = new SearchQuery(queryBuilder, field, searchValue);

if (field.isMultipleCellValue) {
switch (field.cellValueType) {
case CellValueType.DateTime:
return searchQueryBuilder.getDateSqlQuery();
return searchQueryBuilder.getMultipleDateSqlQuery();
case CellValueType.Number:
return searchQueryBuilder.getNumberSqlQuery();
return searchQueryBuilder.getMultipleNumberSqlQuery();
case CellValueType.String:
if (field.isStructuredCellValue) {
return searchQueryBuilder.getJsonSqlQuery();
return searchQueryBuilder.getMultipleJsonSqlQuery();
} else {
return searchQueryBuilder.getTextSqlQuery();
return searchQueryBuilder.getMultipleTextSqlQuery();
}
}
})
.filter((sql) => !!sql);
}

switch (field.cellValueType) {
case CellValueType.DateTime:
return searchQueryBuilder.getDateSqlQuery();
case CellValueType.Number:
return searchQueryBuilder.getNumberSqlQuery();
case CellValueType.String:
if (field.isStructuredCellValue) {
return searchQueryBuilder.getJsonSqlQuery();
} else {
return searchQueryBuilder.getTextSqlQuery();
}
}
});

const knexInstance = queryBuilder.client;

Expand Down

0 comments on commit 298e4b4

Please sign in to comment.