diff --git a/src/Components/API/API.tsx b/src/Components/API/API.tsx index 59131c7..dadd623 100644 --- a/src/Components/API/API.tsx +++ b/src/Components/API/API.tsx @@ -386,3 +386,27 @@ export async function TransactionUpdateAPI( return [false, ParseError(error)]; }); } + +export async function TransactionsByStudentAPI() { + const config = await GetConfig(); + return instance + .get("api/v1/transactions/student/", config) + .then((response) => { + return response.data as TransactionListType; + }) + .catch(() => { + console.log("Error retrieving transactions for current student"); + }); +} + +export async function TransactionsByTeacherAPI() { + const config = await GetConfig(); + return instance + .get("api/v1/transactions/teacher/", config) + .then((response) => { + return response.data as TransactionListType; + }) + .catch(() => { + console.log("Error retrieving transactions for current teacher"); + }); +} diff --git a/src/Components/DashboardPage/Student/StudentTransactionFilterMenu.tsx b/src/Components/DashboardPage/Student/StudentTransactionFilterMenu.tsx index c8cb43f..1cbd438 100644 --- a/src/Components/DashboardPage/Student/StudentTransactionFilterMenu.tsx +++ b/src/Components/DashboardPage/Student/StudentTransactionFilterMenu.tsx @@ -19,12 +19,17 @@ import ShoppingCartCheckoutIcon from "@mui/icons-material/ShoppingCartCheckout"; import AssignmentReturnedIcon from "@mui/icons-material/AssignmentReturned"; import CancelOutlinedIcon from "@mui/icons-material/CancelOutlined"; import CancelIcon from "@mui/icons-material/Cancel"; +import ClearAllIcon from "@mui/icons-material/ClearAll"; import { useState } from "react"; -export default function StudentTransactionFilterMenu() { +type props = { + filter: string; + setFilter: React.Dispatch>; +}; + +export default function StudentTransactionFilterMenu(props: props) { const [addSKUmodalOpen, SetAddSKUModalOpen] = useState(false); const [additemmodalOpen, SetAddItemModalOpen] = useState(false); - const [filter, setFilter] = useState(""); return ( <>

- Filter transactions by + Filter Transactions