Fakultas Ilmu Komputer UI

Commit fe734e1b authored by Azhar Difa Arnanda's avatar Azhar Difa Arnanda
Browse files

Bug fix: undefined stock in add new product

parent 327859f0
Pipeline #63736 passed with stages
in 8 minutes and 8 seconds
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -22,7 +22,7 @@ const FormProduk = ({ onSubmit, initialData = null }) => {
subcategory: initialData["subcategory"],
description: initialData["description"],
price: initialData["price"].split(".")[0],
stock: initialData["stock"],
stock: initialData["stock"].split(".")[0],
modal: initialData["modal"].split(".")[0],
}
: {},
......@@ -158,6 +158,7 @@ const FormProduk = ({ onSubmit, initialData = null }) => {
data-testid="stock-produk-input"
type="number"
name="stock"
ref={register({ required: true })}
/>
{errors.stock && <ErrorDiv>Stok Produk tidak boleh kosong</ErrorDiv>}
</RowInput>
......
Supports Markdown
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