优化前端抛出Inconsistency的异常

This commit is contained in:
Xu Chang 2022-11-01 19:32:07 +08:00
parent fe352c24ce
commit 7e2db01bef
2 changed files with 5 additions and 3 deletions

View File

@ -23,7 +23,7 @@ function getFullProjection(entity, schema) {
exports.getFullProjection = getFullProjection;
function checkFilterContains(entity, schema, contained, context, filter) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var rowStore, filter2, result, data_1;
var rowStore, filter2, projection, result, data_1;
var _a;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
@ -39,8 +39,9 @@ function checkFilterContains(entity, schema, contained, context, filter) {
filter2 = (0, filter_1.combineFilters)([filter, {
$not: contained,
}]);
projection = process.env.OAK_PLATFORM === 'server' ? getFullProjection(entity, schema) : { id: 1 };
return [4 /*yield*/, rowStore.select(entity, {
data: getFullProjection(entity, schema),
data: projection,
filter: filter2,
indexFrom: 0,
count: 10,

View File

@ -37,8 +37,9 @@ export async function checkFilterContains<ED extends EntityDict, T extends keyof
const filter2 = combineFilters([filter, {
$not: contained,
}]);
const projection = process.env.OAK_PLATFORM === 'server' ? getFullProjection(entity, schema) : { id: 1 };
const { result } = await rowStore.select(entity, {
data: getFullProjection(entity, schema) as any,
data: projection,
filter: filter2,
indexFrom: 0,
count: 10,