Skip to content

Commit

Permalink
Merge pull request #16 from EXPITC/develop
Browse files Browse the repository at this point in the history
chore: change to axios from fetch
  • Loading branch information
EXPITC authored May 28, 2023
2 parents d0be0f7 + 32285e9 commit 517b9cf
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/CartPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import trash from "../../img/Trash.svg";
import Header from "../Header";
import Map from "../Map";
import { useNavigate } from "react-router";
import axios from "axios";

const CartPage = () => {
const [open, setOpen] = useState(false);
Expand Down Expand Up @@ -188,12 +189,14 @@ const CartPage = () => {
const signal = controller.signal;
(async () => {
try {
await fetch(
`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${loc[0]}&lon=${loc[1]}`,
{ signal }
).then((res) => {
setAddress(res.data);
});
await axios
.get(
`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${loc[0]}&lon=${loc[1]}`,
{ signal }
)
.then((res) => {
setAddress(res.data);
});
setForm((prev) => ({
...prev,
location: loc[0] + " " + loc[1],
Expand Down

1 comment on commit 517b9cf

@vercel
Copy link

@vercel vercel bot commented on 517b9cf May 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

foodways – ./

foodways-expitc.vercel.app
foodways-git-main-expitc.vercel.app
foodways.vercel.app

Please sign in to comment.