From 31ca33f249b71561dcf5dd26a5b39728ad5c908c Mon Sep 17 00:00:00 2001 From: junamee Date: Fri, 4 Jun 2021 03:28:57 +0900 Subject: [PATCH] Feat. wishtoggle api #45 --- frontend/src/customHook/axiosAPI.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/customHook/axiosAPI.tsx b/frontend/src/customHook/axiosAPI.tsx index 6433b7ce4..979ab2d29 100644 --- a/frontend/src/customHook/axiosAPI.tsx +++ b/frontend/src/customHook/axiosAPI.tsx @@ -1,7 +1,7 @@ import axios from 'axios' import { FilterDateToForm } from './useDateInfo' import { defaultValue } from './atoms' - +import {IParams} from '../Interface' export async function getFeeData( city: string | undefined, checkIn: string | number | undefined, @@ -54,9 +54,8 @@ export async function getHouseData(value: any) { adult, child, baby, - }: DetailProps = value + }: IParams = value - console.log(value) let guestAdult = Number(adult) let guestChild = Number(child) let guestBaby = Number(baby) @@ -94,3 +93,10 @@ export async function getHouseData(value: any) { const response = await axios.get(url) return response } + +export async function wishToggle(id:number){ + let url = `http://13.125.140.183/rooms/${id}/wish` + const response = await axios.patch(url) + console.log(response) + return response +}