@@ -6,6 +6,8 @@ import { useState } from "react";
66
77import {
88 organization_clean_backend_calls_return_interface ,
9+ organization_clean_backend_calls_return_number_interface ,
10+ useOrganizationBackendCountItemsDueThisWeek ,
911 useOrganizationBackendGetItems ,
1012} from "@/components/ui/backend/organization_clean_backend_calls" ;
1113import Inventory_Details_Modal , {
@@ -18,6 +20,8 @@ import Statistics_Card from "../components/ui/card_organization_statistics";
1820import Header from "../components/ui/navbar_organization" ;
1921
2022const Organization_Dashboard = ( ) => {
23+ // calling backend starts //
24+
2125 // this is for calling the data for the modal
2226 const {
2327 data,
@@ -31,6 +35,24 @@ const Organization_Dashboard = () => {
3135 console . log ( "Error state:" , error ) ;
3236 console . log ( "Refresh function:" , refresh ) ;
3337
38+ // this is for calling the data for the modal
39+ const {
40+ data : countItemsDueThisWeekData ,
41+ loading : countItemsDueThisWeekLoading ,
42+ error : countItemsDueThisWeekError ,
43+ refresh : countItemsDueThisWeekRefresh ,
44+ } : organization_clean_backend_calls_return_number_interface = useOrganizationBackendCountItemsDueThisWeek ( ) ;
45+
46+ console . log (
47+ "Data from useOrganizationBackendCountItemsDueThisWeek:" ,
48+ countItemsDueThisWeekData ,
49+ ) ;
50+ console . log ( "Loading state:" , countItemsDueThisWeekLoading ) ;
51+ console . log ( "Error state:" , countItemsDueThisWeekError ) ;
52+ console . log ( "Refresh function:" , countItemsDueThisWeekRefresh ) ;
53+
54+ // calling backend ends //
55+
3456 // This is for the overlay modal
3557 const [ isModalOpen , setIsModalOpen ] = useState ( false ) ;
3658 const [ selectedItemData , setSelectedItemData ] =
@@ -93,7 +115,7 @@ const Organization_Dashboard = () => {
93115 />
94116 < Statistics_Card
95117 title = "Inventory Due"
96- value = { 2 }
118+ value = { countItemsDueThisWeekData }
97119 delta = "-10 this week"
98120 status = "down"
99121 />
0 commit comments