diff --git a/android/gradlew b/android/gradlew old mode 100644 new mode 100755 diff --git a/src/OrderComponent.js b/src/OrderComponent.js index eda654b..a78457b 100644 --- a/src/OrderComponent.js +++ b/src/OrderComponent.js @@ -1,51 +1,26 @@ -import React, { useState } from 'react' -import { usePlaceOrder } from './usePlaceOrder' -import {ToastAndroid} from 'react-native'; +import React, {useState} from 'react'; +import {ToastAndroid, Text, View, Button} from 'react-native'; +import {useMutation} from '@tanstack/react-query'; function OrderComponent() { - const { mutate, isLoading, isError, error, data } = usePlaceOrder() - const [orderData, setOrderData] = useState({ title: '', body: '', userId: 1 }) + const mutation = useMutation(['placeOrder']); + const [orderData, setOrderData] = useState({title: '', body: '', userId: 1}); - const handlePlaceOrder = () => { - mutate(orderData) - } + const handlePlaceOrder = id => { + mutation.mutate({title: '', body: '', userId: id}); + }; return ( -
-

Place Order

-
{ - e.preventDefault() - handlePlaceOrder() - }} - > -
- -
-
-