2020-04-08 09:56:36 +00:00
|
|
|
import Controller from '@ember/controller';
|
2020-07-01 14:27:29 +00:00
|
|
|
import { get, computed } from '@ember/object';
|
2020-04-08 09:56:36 +00:00
|
|
|
|
2020-11-09 09:25:35 +00:00
|
|
|
export default class ServicesController extends Controller {
|
|
|
|
queryParams = {
|
2020-05-29 15:42:46 +00:00
|
|
|
search: {
|
2020-04-08 09:56:36 +00:00
|
|
|
as: 'filter',
|
|
|
|
replace: true,
|
|
|
|
},
|
2020-11-09 09:25:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@computed('item.Checks.[]')
|
|
|
|
get checks() {
|
2020-07-01 14:27:29 +00:00
|
|
|
const checks = {};
|
|
|
|
get(this, 'item.Checks')
|
|
|
|
.filter(item => {
|
|
|
|
return item.ServiceID !== '';
|
|
|
|
})
|
|
|
|
.forEach(item => {
|
|
|
|
if (typeof checks[item.ServiceID] === 'undefined') {
|
|
|
|
checks[item.ServiceID] = [];
|
|
|
|
}
|
|
|
|
checks[item.ServiceID].push(item);
|
|
|
|
});
|
|
|
|
|
|
|
|
return checks;
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
}
|