source: frontend/src/Components/Hooks/Hotel/useCreateHotelRoom.js@ 0f5aa27

Last change on this file since 0f5aa27 was e6c2521, checked in by darsov2 <62809499+darsov2@…>, 10 months ago

images upload/download impl, other fixes

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