salix/modules/client/front/recovery/index/index.js

26 lines
665 B
JavaScript
Raw Normal View History

2018-05-23 12:26:51 +00:00
import ngModule from '../../module';
2018-07-16 06:00:04 +00:00
class Controller {
constructor($stateParams, $scope, $http) {
this.$stateParams = $stateParams;
this.$scope = $scope;
this.$http = $http;
}
2018-07-16 06:00:04 +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-07-16 06:00:04 +00:00
Controller.$inject = ['$stateParams', '$scope', '$http'];
2018-05-23 12:26:51 +00:00
ngModule.component('vnClientRecoveryIndex', {
template: require('./index.html'),
controller: Controller
});