mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
update nummber of free places after event reservation payment
This commit is contained in:
parent
b9411366c2
commit
63a9f8bf95
@ -464,7 +464,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
|
|||||||
# @param member {Object} User as retreived from the API: current user / selected user if current is admin
|
# @param member {Object} User as retreived from the API: current user / selected user if current is admin
|
||||||
# @param reserve {Object} Reservation parameters (places...)
|
# @param reserve {Object} Reservation parameters (places...)
|
||||||
# @param event {Object} Current event
|
# @param event {Object} Current event
|
||||||
# @return {{user_id:Number, reservable_id:Number, reservable_type:String, slots_attributes:Array<Object>, nb_reserve_places:Number, nb_reserve_reduced_places:Number}}
|
# @return {{user_id:number, reservable_id:number, reservable_type:string, slots_attributes:Array<Object>, nb_reserve_places:number}}
|
||||||
##
|
##
|
||||||
mkReservation = (member, reserve, event) ->
|
mkReservation = (member, reserve, event) ->
|
||||||
reservation =
|
reservation =
|
||||||
@ -663,7 +663,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
|
|||||||
# @param resveration {Object} booked reservation
|
# @param resveration {Object} booked reservation
|
||||||
##
|
##
|
||||||
afterPayment = (reservation)->
|
afterPayment = (reservation)->
|
||||||
$scope.event.nb_free_places = $scope.event.nb_free_places - reservation.nb_reserve_places - reservation.nb_reserve_reduced_places
|
$scope.event.nb_free_places = $scope.event.nb_free_places - reservation.total_booked_seats
|
||||||
resetEventReserve()
|
resetEventReserve()
|
||||||
$scope.reserveSuccess = true
|
$scope.reserveSuccess = true
|
||||||
$scope.reservations.push reservation
|
$scope.reservations.push reservation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user