aboutsummaryrefslogtreecommitdiff
path: root/src/components/tables
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-09-27 21:42:51 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-09-27 21:42:51 +0530
commit39819430fa47172c1a3a36218339f6baf86f8983 (patch)
treedafe65a48fcceb60b588c613e2d92be4c514633b /src/components/tables
parent072e53f0b2eb8fa14c0aa49286193784c73257cb (diff)
added edit option for items and brands
Diffstat (limited to 'src/components/tables')
-rw-r--r--src/components/tables/brand-table.js6
-rw-r--r--src/components/tables/client-table.js2
-rw-r--r--src/components/tables/item-table.js2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/components/tables/brand-table.js b/src/components/tables/brand-table.js
index 4b361a1..db8272c 100644
--- a/src/components/tables/brand-table.js
+++ b/src/components/tables/brand-table.js
@@ -19,8 +19,8 @@ import './scss/brand-table.scss';
import { deleteBrand } from './../../classes/brand';
const BrandTable = (props) => {
- const handleEdit = (i) => {
- alert("editing coming soon")
+ const handleEdit = (b) => {
+ props.setBrandToEdit(b)
}
const handleDelete = (b) => {
@@ -39,7 +39,7 @@ const BrandTable = (props) => {
return (
<div className={"brand-table"}>
{props.brands && props.brands.map(i =>
- <div className={"brand"}>
+ <div key={i.Id} className={"brand"}>
<p className={"brand-name"}>{i.Name}</p>
<div className={"buttons"}>
<input type="button" value="Edit" onClick={() => handleEdit(i)}/>
diff --git a/src/components/tables/client-table.js b/src/components/tables/client-table.js
index 466316a..ffbf5e8 100644
--- a/src/components/tables/client-table.js
+++ b/src/components/tables/client-table.js
@@ -20,7 +20,7 @@ import { deleteClient } from './../../classes/client';
const ClientTable = (props) => {
const handleEdit = (i) => {
- alert("editing coming soon")
+ props.setItemToEdit(i)
}
const handleDelete = (c) => {
diff --git a/src/components/tables/item-table.js b/src/components/tables/item-table.js
index e42b272..208fd9c 100644
--- a/src/components/tables/item-table.js
+++ b/src/components/tables/item-table.js
@@ -22,7 +22,7 @@ import { faPencil, faTrashCan } from '@fortawesome/free-solid-svg-icons'
const ItemTable = (props) => {
const handleEdit = (i) => {
- alert("editing coming soon")
+ props.setItemToEdit(i)
}
const handleDelete = (i) => {