2018-05-23 12:26:51 +00:00
|
|
|
import ngModule from '../../module';
|
2018-03-01 10:55:28 +00:00
|
|
|
|
2018-07-16 06:00:04 +00:00
|
|
|
class Controller {
|
|
|
|
constructor($stateParams, $scope, $http) {
|
|
|
|
this.$stateParams = $stateParams;
|
|
|
|
this.$scope = $scope;
|
2018-03-09 13:54:25 +00:00
|
|
|
this.$http = $http;
|
|
|
|
}
|
2018-07-16 06:00:04 +00:00
|
|
|
|
2018-03-09 13:54:25 +00:00
|
|
|
setFinished(recovery) {
|
|
|
|
if (!recovery.finished) {
|
|
|
|
let params = {finished: Date.now()};
|
|
|
|
this.$http.patch(`/client/api/Recoveries/${recovery.id}`, params).then(
|
2018-07-16 06:00:04 +00:00
|
|
|
() => this.$scope.model.refresh()
|
2018-03-09 13:54:25 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-16 06:00:04 +00:00
|
|
|
Controller.$inject = ['$stateParams', '$scope', '$http'];
|
2018-03-09 13:54:25 +00:00
|
|
|
|
2018-05-23 12:26:51 +00:00
|
|
|
ngModule.component('vnClientRecoveryIndex', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
2018-03-01 10:55:28 +00:00
|
|
|
});
|