mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: edit details, roles and columns of custom view.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Model } from 'objection';
|
||||
import BaseModel from '@/models/Model';
|
||||
|
||||
export default class ViewColumn extends BaseModel {
|
||||
@@ -14,4 +15,26 @@ export default class ViewColumn extends BaseModel {
|
||||
static get hasTimestamps() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Relationship mapping.
|
||||
*/
|
||||
static get relationMappings() {
|
||||
const ResourceField = require('@/models/ResourceField');
|
||||
|
||||
return {
|
||||
/**
|
||||
* View role model may belongs to resource field model.
|
||||
*/
|
||||
field: {
|
||||
relation: Model.BelongsToOneRelation,
|
||||
modelClass: ResourceField.default,
|
||||
join: {
|
||||
from: 'view_columns.fieldId',
|
||||
to: 'resource_fields.id',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user