source: frontend/src/Components/Hooks/Hotel/useCreateRoomAvailability.js@ 07f4e8b

Last change on this file since 07f4e8b was e6c2521, checked in by darsov2 <62809499+darsov2@…>, 6 months ago

images upload/download impl, other fixes

  • Property mode set to 100644
File size: 794 bytes
Line 
1import React from "react";
2
3import axios from "../../../axios.js";
4import { useNavigate } from "react-router-dom";
5
6const useCreateRoomAvailiability = (hotelRoomId) => {
7
8 const createRoomAvailability = async (hotelRoomAvailable, id) => {
9 console.log({hotelRoomAvailable})
10 console.log(hotelRoomAvailable)
11 await axios
12 .post(`/hotel/rooms/available/${id}/add`, hotelRoomAvailable, {
13 params: {
14 hotelId: hotelRoomId
15 }
16 })
17 .then((res) => {
18 //history.push('/hotel');
19 })
20 .catch((err) => {
21 console.log(err);
22 })
23 .finally(() => {
24 });
25 }
26
27 return {
28 createRoomAvailability
29 };
30
31}
32
33export default useCreateRoomAvailiability;
Note: See TracBrowser for help on using the repository browser.