mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
fix: resource advanced view filter.
This commit is contained in:
@@ -12,7 +12,7 @@ export default class View extends TenantModel {
|
||||
/**
|
||||
* Model timestamps.
|
||||
*/
|
||||
static get timestamps() {
|
||||
get timestamps() {
|
||||
return ['createdAt', 'updatedAt'];
|
||||
}
|
||||
|
||||
@@ -40,23 +40,10 @@ export default class View extends TenantModel {
|
||||
* Relationship mapping.
|
||||
*/
|
||||
static get relationMappings() {
|
||||
const Resource = require('models/Resource');
|
||||
const ViewColumn = require('models/ViewColumn');
|
||||
const ViewRole = require('models/ViewRole');
|
||||
|
||||
return {
|
||||
/**
|
||||
* View model belongs to resource model.
|
||||
*/
|
||||
resource: {
|
||||
relation: Model.BelongsToOneRelation,
|
||||
modelClass: this.relationBindKnex(Resource.default),
|
||||
join: {
|
||||
from: 'views.resourceId',
|
||||
to: 'resources.id',
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* View model may has many columns.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user