Skip to content

Commit

Permalink
chore: lint fixes for payroll services
Browse files Browse the repository at this point in the history
Runs `eslint --fix` on the services associated with human resources and
payroll.
  • Loading branch information
jniles committed Feb 6, 2025
1 parent 7111960 commit ede1f3b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.
8 changes: 3 additions & 5 deletions client/src/modules/grades/grades.service.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
angular.module('bhima.services')
.service('GradeService', GradeService);

GradeService.$inject = ['PrototypeApiService', '$uibModal'];
GradeService.$inject = ['PrototypeApiService'];

/**
* @class GradeService
Expand All @@ -10,8 +10,6 @@ GradeService.$inject = ['PrototypeApiService', '$uibModal'];
* @description
* Encapsulates common requests to the /grades/ URL.
*/
function GradeService(Api, Modal) {
var service = new Api('/grades/');

return service;
function GradeService(Api) {
return new Api('/grades/');
}
39 changes: 20 additions & 19 deletions client/src/modules/holidays/holidays.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module('bhima.controllers')
.controller('HolidayManagementController', HolidayManagementController);
.controller('HolidayManagementController', HolidayManagementController);

HolidayManagementController.$inject = [
'HolidayService', 'ModalService', 'NotifyService', 'uiGridConstants', '$state',
Expand All @@ -12,7 +12,7 @@ HolidayManagementController.$inject = [
* It's responsible for creating, editing and updating a Holiday
*/
function HolidayManagementController(Holidays, ModalService, Notify, uiGridConstants, $state) {
var vm = this;
const vm = this;

// bind methods
vm.deleteHoliday = deleteHoliday;
Expand Down Expand Up @@ -87,28 +87,28 @@ function HolidayManagementController(Holidays, ModalService, Notify, uiGridConst
vm.loading = true;

Holidays.read(null, { detailed : 1 })
.then(function (data) {
vm.gridOptions.data = data;
})
.catch(Notify.handleError)
.finally(function () {
vm.loading = false;
});
.then((data) => {
vm.gridOptions.data = data;
})
.catch(Notify.handleError)
.finally(() => {
vm.loading = false;
});
}

// switch to delete warning mode
function deleteHoliday(title) {
ModalService.confirm('FORM.DIALOGS.CONFIRM_DELETE')
.then(function (bool) {
if (!bool) { return; }
.then((bool) => {
if (!bool) { return; }

Holidays.delete(title.id)
.then(function () {
Notify.success('FORM.LABELS.DELETED');
loadHolidays();
})
.catch(Notify.handleError);
});
Holidays.delete(title.id)
.then(() => {
Notify.success('FORM.LABELS.DELETED');
loadHolidays();
})
.catch(Notify.handleError);
});
}

// update an existing Holiday
Expand All @@ -117,4 +117,5 @@ function HolidayManagementController(Holidays, ModalService, Notify, uiGridConst
}

loadHolidays();
}
}

9 changes: 4 additions & 5 deletions client/src/modules/holidays/holidays.service.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
angular.module('bhima.services')
.service('HolidayService', HolidayService);

HolidayService.$inject = ['PrototypeApiService', '$uibModal'];
HolidayService.$inject = ['PrototypeApiService'];

/**
* @class HolidayService
Expand All @@ -10,8 +10,7 @@ HolidayService.$inject = ['PrototypeApiService', '$uibModal'];
* @description
* Encapsulates common requests to the /holidays/ URL.
*/
function HolidayService(Api, Modal) {
var service = new Api('/holidays/');
function HolidayService(Api) {
return new Api('/holidays/');
}

return service;
}

0 comments on commit ede1f3b

Please sign in to comment.