Commit 0ee4f191 authored by John Lam's avatar John Lam

cleaned up update form and promo list

parent 9c2fe6a4
......@@ -100,6 +100,8 @@ export default function PromotionNewFormComponent (props) {
})}
/>
{errors.productSku && <p className="form-error">{errors.productSku.message}</p>}
<br></br>
</div>
......
......@@ -42,7 +42,8 @@ export default function PromotionUpdateFormComponent(props) {
setValue('productSku', data.value)
}
const productSku = register('productSku', { required: true })
register('productSku', { required: true })
setValue('productSku', props.location.state.promo.productSku);
return (
<div>
<div className="promo-container">
......@@ -57,7 +58,7 @@ export default function PromotionUpdateFormComponent(props) {
{...register("promotionId", {
value: props.location.state.promo.promotionId,
required: "promotion id is required",
maxLength: { value: 10, message: "You exceeded the maximum value" },
maxLength: { value: 20, message: "You exceeded the maximum value" },
})}
readOnly
......@@ -87,6 +88,8 @@ export default function PromotionUpdateFormComponent(props) {
}
})} />
{errors.productSku && <p className="form-error">{errors.productSku.message}</p>}
{errors.productSku && console.log(errors) && <p className="form-error">{errors.productSku.message}</p>}
<br></br>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment