From 673e7c007e6f4ea90875dc7e2520641743af4116 Mon Sep 17 00:00:00 2001 From: Facundo De Lorenzo Date: Sat, 18 May 2024 13:33:51 -0300 Subject: [PATCH] updated readme & api endpoint --- README.md | 5 +++++ packages/front/.env.production | 2 +- packages/front/src/App.tsx | 2 +- .../contexts/{ => currentOrder}/useCurrentOrderContext.tsx | 2 +- .../contexts/{ => currentOrder}/useCurrentOrderProvider.tsx | 2 +- packages/front/src/components/app/hooks/useCreateOrder.ts | 3 +-- packages/front/src/index.tsx | 1 - 7 files changed, 10 insertions(+), 7 deletions(-) rename packages/front/src/components/app/contexts/{ => currentOrder}/useCurrentOrderContext.tsx (90%) rename packages/front/src/components/app/contexts/{ => currentOrder}/useCurrentOrderProvider.tsx (90%) diff --git a/README.md b/README.md index 572b5ad..a505477 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ So as to be able to run the API you must first get the AWS SAM CLI because it's Get the latest version of AWS SAM CLI from here https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html +Front is deployed at +http://wakeup-fullstack-challenge.s3-website-us-east-1.amazonaws.com/ + +Api is deployed at +https://n6nzscrpv7.execute-api.us-east-1.amazonaws.com/Prod Tests for the backend were not implemented. If they were to be implemented, I'd use jest. diff --git a/packages/front/.env.production b/packages/front/.env.production index eebbcf7..9a58a10 100644 --- a/packages/front/.env.production +++ b/packages/front/.env.production @@ -1 +1 @@ -REACT_APP_API_ENDPOINT=https://bpphj904g4.execute-api.us-east-1.amazonaws.com/Prod \ No newline at end of file +REACT_APP_API_ENDPOINT=https://n6nzscrpv7.execute-api.us-east-1.amazonaws.com/Prod \ No newline at end of file diff --git a/packages/front/src/App.tsx b/packages/front/src/App.tsx index d1cf9de..df52ad9 100644 --- a/packages/front/src/App.tsx +++ b/packages/front/src/App.tsx @@ -5,7 +5,7 @@ import { createRoutesFromElements, } from "react-router-dom"; import Products from "./pages/Products"; -import { CurrentOrderProvider } from "./components/app/contexts/useCurrentOrderProvider"; +import { CurrentOrderProvider } from "./components/app/contexts/currentOrder/useCurrentOrderProvider"; import Restaurants from "./pages/Restaurant"; const App = () => { diff --git a/packages/front/src/components/app/contexts/useCurrentOrderContext.tsx b/packages/front/src/components/app/contexts/currentOrder/useCurrentOrderContext.tsx similarity index 90% rename from packages/front/src/components/app/contexts/useCurrentOrderContext.tsx rename to packages/front/src/components/app/contexts/currentOrder/useCurrentOrderContext.tsx index 5d16822..98e8f33 100644 --- a/packages/front/src/components/app/contexts/useCurrentOrderContext.tsx +++ b/packages/front/src/components/app/contexts/currentOrder/useCurrentOrderContext.tsx @@ -1,5 +1,5 @@ import { createContext, useContext } from "react"; -import { OrderProduct } from "../hooks/useCreateOrder"; +import { OrderProduct } from "../../hooks/useCreateOrder"; interface CurrentOrderContextType { orderProducts: OrderProduct[]; diff --git a/packages/front/src/components/app/contexts/useCurrentOrderProvider.tsx b/packages/front/src/components/app/contexts/currentOrder/useCurrentOrderProvider.tsx similarity index 90% rename from packages/front/src/components/app/contexts/useCurrentOrderProvider.tsx rename to packages/front/src/components/app/contexts/currentOrder/useCurrentOrderProvider.tsx index 52a6ed3..a856958 100644 --- a/packages/front/src/components/app/contexts/useCurrentOrderProvider.tsx +++ b/packages/front/src/components/app/contexts/currentOrder/useCurrentOrderProvider.tsx @@ -1,6 +1,6 @@ import { ReactNode, useState } from "react"; import { CurrentOrderContext } from "./useCurrentOrderContext"; -import { OrderProduct } from "../hooks/useCreateOrder"; +import { OrderProduct } from "../../hooks/useCreateOrder"; export interface ICurrentOrderProvider { children: ReactNode; diff --git a/packages/front/src/components/app/hooks/useCreateOrder.ts b/packages/front/src/components/app/hooks/useCreateOrder.ts index d29299d..27555fd 100644 --- a/packages/front/src/components/app/hooks/useCreateOrder.ts +++ b/packages/front/src/components/app/hooks/useCreateOrder.ts @@ -1,7 +1,6 @@ import { Product } from "./useGetProducts"; -import { useCurrentOrderContext } from "../contexts/useCurrentOrderContext"; +import { useCurrentOrderContext } from "../contexts/currentOrder/useCurrentOrderContext"; import axios from "axios"; -import { useState } from "react"; export interface Order { products: OrderProduct[]; diff --git a/packages/front/src/index.tsx b/packages/front/src/index.tsx index ddb1a4d..8688b48 100644 --- a/packages/front/src/index.tsx +++ b/packages/front/src/index.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App';