From fecdf38d5f0d2a789775e39661a89e46174d9e02 Mon Sep 17 00:00:00 2001 From: John Lam <jlam@nisum.com> Date: Mon, 10 May 2021 15:04:16 -0700 Subject: [PATCH] fixed some merge conflicts and errors on my part --- src/component/Main.jsx | 2 +- src/component/ProductForm.jsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/component/Main.jsx b/src/component/Main.jsx index f8ca5d5..d502310 100644 --- a/src/component/Main.jsx +++ b/src/component/Main.jsx @@ -24,7 +24,7 @@ export default function Main() { <AuthRoute exact path="/products/new"> <ProductForm method="POST" /> </AuthRoute> - <AuthRoute exact path="/products/edit/:sku"> + <AuthRoute exact path="/products/edit/:productId"> <ProductForm method="PUT" /> </AuthRoute> <AuthRoute diff --git a/src/component/ProductForm.jsx b/src/component/ProductForm.jsx index 5644d60..a7a0c30 100644 --- a/src/component/ProductForm.jsx +++ b/src/component/ProductForm.jsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from "react"; import { useHistory, useParams } from "react-router"; import emptyProduct from "../emptProduct"; +import Config from '../config'; const emptyForm = { ...emptyProduct, @@ -78,7 +79,7 @@ export default function ProductForm(props) { // console.log(form); const url = method === "PUT" - ? `${Config.inventoryUrl}/${sku}` + ? `${Config.inventoryUrl}/${productId}` : `${Config.inventoryUrl}`; fetch(url, { method, -- GitLab