|
| 1 | +import { mergeWith } from 'lodash' |
1 | 2 | import { |
2 | 3 | FindOperator, |
3 | 4 | FindOptionsRelationByString, |
|
7 | 8 | } from 'typeorm' |
8 | 9 | import { ColumnMetadata } from 'typeorm/metadata/ColumnMetadata' |
9 | 10 | import { OrmUtils } from 'typeorm/util/OrmUtils' |
10 | | -import { mergeWith } from 'lodash' |
11 | 11 |
|
12 | 12 | /** |
13 | 13 | * Joins 2 keys as `K`, `K.P`, `K.(P` or `K.P)` |
@@ -205,10 +205,10 @@ export function checkIsJsonb(qb: SelectQueryBuilder<unknown>, propertyName: stri |
205 | 205 | const parts = propertyName.split('.') |
206 | 206 | const dbColumnName = parts[parts.length - 2] |
207 | 207 |
|
208 | | - return qb?.expressionMap?.mainAlias?.metadata.findColumnWithPropertyName(dbColumnName)?.type === 'json' |
| 208 | + return qb?.expressionMap?.mainAlias?.metadata.findColumnWithPropertyName(dbColumnName)?.type === 'jsonb' |
209 | 209 | } |
210 | 210 |
|
211 | | - return qb?.expressionMap?.mainAlias?.metadata.findColumnWithPropertyName(propertyName)?.type === 'json' |
| 211 | + return qb?.expressionMap?.mainAlias?.metadata.findColumnWithPropertyName(propertyName)?.type === 'jsonb' |
212 | 212 | } |
213 | 213 |
|
214 | 214 | // This function is used to fix the column alias when using relation, embedded or virtual properties |
@@ -293,7 +293,7 @@ export function isFindOperator<T>(value: unknown | FindOperator<T>): value is Fi |
293 | 293 | export function createRelationSchema<T>(configurationRelations: RelationSchemaInput<T>): RelationSchema<T> { |
294 | 294 | return Array.isArray(configurationRelations) |
295 | 295 | ? OrmUtils.propertyPathsToTruthyObject(configurationRelations) |
296 | | - : configurationRelations |
| 296 | + : (configurationRelations as RelationSchema<T>) |
297 | 297 | } |
298 | 298 |
|
299 | 299 | export function mergeRelationSchema(...schemas: RelationSchema[]) { |
|
0 commit comments