Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
model(params) {
let store = this.get('store');
let modelName = 'fd-dev-stage';
let projectionName = 'ListFormView';
let builder = new Builder(store)
.from(modelName)
.selectByProjection(projectionName)
.orderBy('changeDate desc');
if (params.search) {
let predicate = new ComplexPredicate(Condition.Or,
new StringPredicate('name').contains(params.search),
new StringPredicate('description').contains(params.search));
builder.where(predicate);
}
return hash({
projects: store.query(modelName, builder.build()),
});
},
model(params) {
let store = this.get('store');
let modelName = 'fd-dev-stage';
let projectionName = 'ListFormView';
let builder = new Builder(store)
.from(modelName)
.selectByProjection(projectionName)
.orderBy('changeDate desc');
if (params.search) {
let predicate = new ComplexPredicate(Condition.Or,
new StringPredicate('name').contains(params.search),
new StringPredicate('description').contains(params.search));
builder.where(predicate);
}
return hash({
projects: store.query(modelName, builder.build()),
});
},