1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

feat: Supporto alle relations included

This commit is contained in:
Maicol Battistini
2022-01-10 16:01:09 +01:00
parent 48b26b372d
commit f0982961c0
2 changed files with 9 additions and 6 deletions

View File

@@ -73,7 +73,8 @@ export class RecordsPage extends Page {
async oninit(vnode: Vnode) {
super.oninit(vnode);
const response = await this.model.all();
// @ts-ignore
const response = await this.model.with(this.model.relationships).get();
const data = response.getData() as Model[];
if (data.length > 0) {
@@ -152,7 +153,7 @@ export class RecordsPage extends Page {
async updateRecord(id: number) {
// @ts-ignore
const response = await this.model.find(id);
const response = await this.model.with(this.model.relationships).find(id);
const instance = response.getData() as IModel;
const dialog = $('mwc-dialog#add-record-dialog');