mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-19 08:52:25 +01:00
(bug) unable to cancel a machine reservation + unable to update member profile
This commit is contained in:
parent
0d072291c7
commit
e0944746a9
@ -554,7 +554,24 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$tran
|
||||
$scope.updateMember = function () {
|
||||
$scope.plansAreShown = false;
|
||||
$scope.selectedPlan = null;
|
||||
Member.get({ id: $scope.ctrl.member.id }, function (member) { $scope.ctrl.member = member; });
|
||||
Member.get({ id: $scope.ctrl.member.id }, function (member) {
|
||||
$scope.ctrl.member = member;
|
||||
const view = uiCalendarConfig.calendars.calendar.fullCalendar('getView');
|
||||
return Availability.machine({
|
||||
machineId: $scope.machine.id,
|
||||
member_id: $scope.ctrl.member.id,
|
||||
start: view.start,
|
||||
end: view.end,
|
||||
timezone: Fablab.timezone
|
||||
}, function (slots) {
|
||||
uiCalendarConfig.calendars.calendar.fullCalendar('removeEvents');
|
||||
return $scope.eventSources.splice(0, 1, {
|
||||
events: slots,
|
||||
textColor: 'black'
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -556,7 +556,12 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs',
|
||||
// slot is reserved and currently modified
|
||||
// -> we cancel the modification
|
||||
$scope.cancelModifySlot();
|
||||
} else if ($scope.slot.is_reserved && (slotCanBeModified($scope.slot) || slotCanBeCanceled($scope.slot)) && !$scope.events.modifiable && ($scope.events.reserved.length === 0)) {
|
||||
} else if ($scope.slot.is_reserved &&
|
||||
(slotCanBeModified($scope.slot) || slotCanBeCanceled($scope.slot)) &&
|
||||
!$scope.events.modifiable &&
|
||||
($scope.events.reserved.length === 0) &&
|
||||
$scope.user &&
|
||||
$scope.slot.users.map(u => u.id).includes($scope.user.id)) {
|
||||
// slot is reserved and is ok to be modified or cancelled
|
||||
// but we are not currently running a modification or having any slots in the cart
|
||||
// -> first affect the modification/cancellation rights attributes to the current slot
|
||||
|
@ -36,7 +36,7 @@ class Members::MembersService
|
||||
end
|
||||
end
|
||||
|
||||
MembersService.handle_organization(params)
|
||||
Members::MembersService.handle_organization(params)
|
||||
|
||||
not_complete = member.need_completion?
|
||||
up_result = member.update(params)
|
||||
|
Loading…
x
Reference in New Issue
Block a user