Skip to content

Commit cc9d112

Browse files
committed
added delete to modals, pending new getFunctions for the dashboard for the backend call
1 parent 0756243 commit cc9d112

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

client/src/components/ui/card_organization_inventory_details_modal.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Key components
1818
import Link from "next/link";
1919
import React from "react";
2020

21+
import { deleteItemClean } from "./backend/organization_clean_backend_calls";
22+
2123
// Define the shape of the data this modal expects
2224
// id? means optional
2325
interface Inventory_Details_Interface {
@@ -104,6 +106,13 @@ const Inventory_Details_Modal: React.FC<Inventory_Details_Modal_Interface> = ({
104106
>
105107
<div className="modal-action-button secondary">Modify</div>
106108
</Link>
109+
110+
<button
111+
onClick={() => deleteItemClean(itemData.id || 0)}
112+
className="modal-action-button secondary"
113+
>
114+
Delete
115+
</button>
107116
</div>
108117
</div>
109118
</div>

client/src/components/ui/card_organization_member_details_modal.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ Key components
1515
3. The overlay component itself
1616
*/
1717

18+
import Link from "next/dist/client/link";
1819
import React from "react";
1920

21+
import { deleteItemClean } from "./backend/organization_clean_backend_calls";
22+
2023
// Define the shape of the data this modal expects
2124
// id? means optional
2225
export interface Member_Details_Interface {
@@ -105,6 +108,28 @@ export const Member_Details_Modal: React.FC<Member_Details_Modal_Interface> = ({
105108
</ul>
106109
</div>
107110
</div>
111+
112+
{/* NEW ACTION BUTTONS */}
113+
<div className="modal-actions">
114+
<Link
115+
href={{
116+
pathname: "/organization_add_member",
117+
query: {
118+
mode: "modify",
119+
data: JSON.stringify(itemData),
120+
},
121+
}}
122+
>
123+
<div className="modal-action-button secondary">Modify</div>
124+
</Link>
125+
126+
<button
127+
onClick={() => deleteItemClean(itemData.id || 0)}
128+
className="modal-action-button secondary"
129+
>
130+
Delete
131+
</button>
132+
</div>
108133
</div>
109134
</div>
110135
);

0 commit comments

Comments
 (0)