cheetah-framework
Version:
Cheetah Framework JS used in all our applications
28 lines (21 loc) • 475 B
JavaScript
import { Model } from './Model'
class GridSelection extends Model {
get isCustomType () {
return this.type === 'custom'
}
get isCriteriaType () {
return this.type === 'criteria'
}
toCriteriaSelection () {
if (this.isCustomType) {
this.criteria = [{
field: 'id',
operator: 'in',
value: this.items.map(item => item.id).join(',')
}]
delete this.items
}
return this
}
}
export default GridSelection