feat: Cachable and date session model.

This commit is contained in:
Ahmed Bouhuolia
2020-05-20 06:51:34 +02:00
parent 10f636d2bc
commit 90dc83c70a
18 changed files with 638 additions and 200 deletions

View File

@@ -0,0 +1,32 @@
import {
request,
expect,
} from '~/testInit';
import Account from '@/models/Account';
import {
tenantWebsite,
tenantFactory,
loginRes
} from '~/dbInit';
import { times } from 'lodash';
describe.only('CachableModel', () => {
describe('remember()', () => {
it('Should retrieve the data from the storage.', async () => {
for (let i = 0; i < 1; i++) {
const account = await Account.tenant().query()
.remember()
.where('id', 1);
const account2 = await Account.tenant().query()
.remember()
.withGraphFetched('balance');
console.log(account2);
// \\\
}
// Account.flushCache();
});
});
});