cascadeStore对undefined的entity多对一关系返回值的容错

This commit is contained in:
Xu Chang 2022-10-14 16:50:31 +08:00
parent c70bdd6c9e
commit c0898eb9cf
2 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ var CascadeStore = /** @class */ (function (_super) {
};
CascadeStore.prototype.reduceDescendants = function (entity, rows) {
var _this = this;
return rows.map(function (row) {
return rows.filter(function (ele) { return !!ele; }).map(function (row) {
var _a;
var row2 = {};
for (var attr in row) {

View File

@ -84,7 +84,7 @@ export abstract class CascadeStore<ED extends EntityDict & BaseEntityDict, Cxt e
}
private reduceDescendants<T extends keyof ED, S extends ED[T]['Selection']>(entity: T, rows: SelectRowShape<ED[T]['Schema'], S['data']>[]) {
return rows.map(
return rows.filter(ele => !!ele).map(
(row) => {
const row2 = {} as typeof row;
for (const attr in row) {