fix: order order
This commit is contained in:
@@ -29,12 +29,12 @@ export class OrderRepository extends Repository<Order> {
|
||||
})
|
||||
})
|
||||
).then(flatten)
|
||||
|
||||
const entitiesAndRelations = entitiesIdsWithRelations.concat(entities)
|
||||
|
||||
const entitiesAndRelationsById = groupBy(entitiesAndRelations, "id")
|
||||
return map(entitiesAndRelationsById, entityAndRelations =>
|
||||
merge({}, ...entityAndRelations)
|
||||
)
|
||||
|
||||
return map(entities, e => merge({}, ...entitiesAndRelationsById[e.id]))
|
||||
}
|
||||
|
||||
public async findOneWithRelations(
|
||||
|
||||
@@ -244,11 +244,10 @@ class OrderService extends BaseService {
|
||||
query.select = select
|
||||
}
|
||||
|
||||
if (relations && relations.length) {
|
||||
query.relations = relations
|
||||
}
|
||||
let rels = relations
|
||||
delete query.relations
|
||||
|
||||
const raw = await orderRepo.findWithRelations(query.relations, query)
|
||||
const raw = await orderRepo.findWithRelations(rels, query)
|
||||
const count = await orderRepo.count(query)
|
||||
const orders = raw.map(r => this.decorateTotals_(r, totalsToSelect))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user