assets/js/Services/reservationsAPI.js
// Ajout d'une nouvelle reservations
Ajout d'une nouvelle reservations
Ajout d ' une nouvelle reservations
function add(reservation) {
	return Axios.post(RESERVATIONS_API, reservation).then(async (response) => {
		const cachedReservations = await Cache.get("reservations");
		if (cachedReservations) {
			Cache.set("reservations", [...cachedReservations, response.data]);
		}
		return response;
	});
}
function add ( reservation ) { return Axios . post ( RESERVATIONS_API , reservation ) . then ( async ( response ) => { const cachedReservations = await Cache . get ( "reservations" ) ; if ( cachedReservations ) { Cache . set ( "reservations" , [ ... cachedReservations , response . data ] ) ; } return response ; } ) ; }
Ajout d'une nouvelle reservations
Ajout d ' une nouvelle reservations
// Verification si il se trouve en cache // Mise en cache si il n'y est pas encore