fix: appends merge includes (#905)

This commit is contained in:
ChengLei Shao 2022-10-13 18:44:12 +08:00 committed by chenos
parent 418256820d
commit e6f4db1a73
2 changed files with 7 additions and 1 deletions

View File

@ -188,8 +188,12 @@ describe('repository find', () => {
appends: ['a1', 'a2'], appends: ['a1', 'a2'],
}); });
const data = user.toJSON();
expect(user['a1']).toBeDefined(); expect(user['a1']).toBeDefined();
expect(user['a2']).toBeDefined(); expect(user['a2']).toBeDefined();
expect(data['a1'][0].createdAt).toBeDefined();
expect(data['a2'][0].createdAt).toBeDefined();
}); });
test('filter attribute', async () => { test('filter attribute', async () => {

View File

@ -37,7 +37,9 @@ export async function handleAppendsQuery(options: HandleAppendsQueryOptions) {
const key = appendedResult.include.association; const key = appendedResult.include.association;
const val = appendedResult.rows[i].get(key); const val = appendedResult.rows[i].get(key);
rows[i].set(key, val); rows[i].set(key, val, {
raw: true,
});
} }
} }