source: frontend/src/Components/Hooks/Transport/useCreateTrip.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: 744 bytes
Line 
1import React from "react";
2
3import axios from "../../../axios.js";
4import { useNavigate } from "react-router-dom";
5
6const useCreateTrip = (transportId) => {
7
8 const createTrip = async (trip) => {
9 console.log({trip})
10 console.log(trip)
11 await axios
12 .post(`/transport/available/add`, trip, {
13 params: {
14 userId: localStorage.getItem("userId"),
15 transportId: transportId
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 createTrip
30 };
31
32}
33
34export default useCreateTrip;
Note: See TracBrowser for help on using the repository browser.