fix: update field error (#1645)

This commit is contained in:
ChengLei Shao 2023-04-04 10:44:30 +08:00 committed by GitHub
parent caee2bf213
commit 914260ed7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -43,12 +43,14 @@ export class HasManyRepository extends MultipleRelationRepository implements IHa
addFilter[this.associationField.targetKey] = options.filterByTk; addFilter[this.associationField.targetKey] = options.filterByTk;
} }
return await targetRepository.find({ const findOptions = {
...omit(options, ['filterByTk']), ...omit(options, ['filterByTk', 'where', 'values', 'attributes']),
filter: { filter: {
$and: [options.filter || {}, addFilter], $and: [options.filter || {}, addFilter],
}, },
}); };
return await targetRepository.find(findOptions);
} }
@transaction((args, transaction) => { @transaction((args, transaction) => {

View File

@ -673,6 +673,7 @@ describe('collections repository', () => {
filterByTk: 'a', filterByTk: 'a',
values: { values: {
key: C.key, key: C.key,
collectionName: 'c',
uiSchema: { uiSchema: {
title: 'c-hello-world', title: 'c-hello-world',
}, },