mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-18 07:52:23 +01:00
(bug) unable to refresh machine/space/training calender after pay an reservation
This commit is contained in:
parent
77035d81e2
commit
11a079b3e2
@ -1,5 +1,7 @@
|
||||
# Changelog Fab-manager
|
||||
|
||||
- Fix a bug: unable to refresh machine/space/training calender after pay an reservation
|
||||
|
||||
## v6.0.7 2023 June 20
|
||||
|
||||
- Fix a bug: OpenAPI accounting gateway_object_id missing error
|
||||
|
@ -692,20 +692,9 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$tran
|
||||
* Refetch all events from the API and re-populate the calendar with the resulting slots
|
||||
*/
|
||||
const refreshCalendar = function () {
|
||||
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'
|
||||
}
|
||||
);
|
||||
$scope.eventSources.splice(0, 1, {
|
||||
url: `/api/availabilities/machines/${$transition$.params().id}?member_id=${$scope.ctrl.member.id}`,
|
||||
textColor: 'black'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -609,20 +609,9 @@ Application.Controllers.controller('ReserveSpaceController', ['$scope', '$transi
|
||||
* Refetch all events from the API and re-populate the calendar with the resulting slots
|
||||
*/
|
||||
const refreshCalendar = function () {
|
||||
const view = uiCalendarConfig.calendars.calendar.fullCalendar('getView');
|
||||
return Availability.spaces({
|
||||
spaceId: $scope.space.id,
|
||||
member_id: $scope.ctrl.member.id,
|
||||
start: view.start,
|
||||
end: view.end,
|
||||
timezone: Fablab.timezone
|
||||
}, function (spaces) {
|
||||
uiCalendarConfig.calendars.calendar.fullCalendar('removeEvents');
|
||||
return $scope.eventSources.splice(0, 1, {
|
||||
events: spaces,
|
||||
textColor: 'black'
|
||||
}
|
||||
);
|
||||
$scope.eventSources.splice(0, 1, {
|
||||
url: `/api/availabilities/spaces/${$transition$.params().id}?member_id=${$scope.ctrl.member.id}`,
|
||||
textColor: 'black'
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -385,20 +385,9 @@ Application.Controllers.controller('ReserveTrainingController', ['$scope', '$tra
|
||||
* Refetch all events from the API and re-populate the calendar with the resulting slots
|
||||
*/
|
||||
const refreshCalendar = function () {
|
||||
const view = uiCalendarConfig.calendars.calendar.fullCalendar('getView');
|
||||
const id = $transition$.params().id === 'all' ? $transition$.params().id : $scope.training.id;
|
||||
Availability.trainings({
|
||||
trainingId: id,
|
||||
member_id: $scope.ctrl.member.id,
|
||||
start: view.start,
|
||||
end: view.end,
|
||||
timezone: Fablab.timezone
|
||||
}, function (trainings) {
|
||||
uiCalendarConfig.calendars.calendar.fullCalendar('removeEvents');
|
||||
$scope.eventSources.splice(0, 1, {
|
||||
events: trainings,
|
||||
textColor: 'black'
|
||||
});
|
||||
$scope.eventSources.splice(0, 1, {
|
||||
url: `/api/availabilities/trainings/${$transition$.params().id}`,
|
||||
textColor: 'black'
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user