Skip to content

Commit

Permalink
finished implementing orders/all from url
Browse files Browse the repository at this point in the history
  • Loading branch information
aashiyaaaa committed Apr 4, 2024
1 parent 78dbe4a commit e0416bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 177 deletions.
175 changes: 0 additions & 175 deletions frontend/src/app/reports/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,50 +199,7 @@ export default function Dashboard() {
const [previousOrderData, setPreviousOrderData] = useState< any[]>([]);


function getSelectedLocation(){
return selectedLocation;
}


function fetchAllOrders(){
//location="65d91d857b2e523b16d35778";
//const [orderData, setOrderData] = useState<any[]>([]);
//co nsole.log(API_BASE_URL+"/order/all");
fetch(API_BASE_URL+"/orders/all")
.then(response => response.json())
.then(orderData => setOrderData(orderData));
return orderData;
}


function fetchOrderByLocation(location:string){
location = location.split(' ').join('');
//location="65d91d857b2e523b16d35778";
//const [orderData, setOrderData] = useState<any[]>([]);
//co nsole.log(API_BASE_URL+"/order/"+location);
fetch(API_BASE_URL+"/order/"+location)
.then(response => response.json())
.then(orderData => setOrderData(orderData));
return orderData;
}

function fetchOrderByBrand(brand:string){
brand = brand.split(' ').join('');
//const [orderData, setOrderData] = useState<any[]>([]);
fetch(API_BASE_URL+"/order/"+brand)
.then(response => response.json())
.then(orderData => setOrderData(orderData));
//co nsole.log(API_BASE_URL+"/order/"+brand);
return orderData;
}

function fetchOrderByDate(month:number, year:number){
const [orderData, setOrderData] = useState<any[]>([]);
fetch(API_BASE_URL+"/order/"+month+"-"+year)
.then(response => response.json())
.then(orderData => setOrderData(orderData));
return orderData;
}



Expand Down Expand Up @@ -899,138 +856,6 @@ export default function Dashboard() {
];


const FAKE_DATA = [
{
"_id": "65d91d857b2e523b16d35777",
"name": "Attentive Aashita",
"age": 25,
"region": "Elgin",
"pets": [
{
"isActive": true,
"animal": "large dog",
"vet": true,
"food": "HEB Texhas Pets",
"lbs": 8
},
{
"isActive": true,
"animal": "small dog",
"vet": true,
"food": "HEB Texas Pets",
"lbs": 8
}
]
},
{
"_id": "65d91d857b2e523b16d35778",
"name": "Magnificent Michelle",
"age": 25,
"region": "Lockhart",
"pets": [
{
"isActive": false,
"animal": "small dog",
"vet": true,
"food": "Friskies",
"lbs": 5
},
{
"isActive": true,
"animal": "cat",
"vet": false,
"food": "Wholesomes",
"lbs": 2
}
]
},
{
"_id": "65d91d857b2e523b16d35779",
"name": "Awesome Ayah",
"age": 22,
"region": "McMahan",
"pets": []
},
{
"_id": "65d91d857b2e523b16d3577a",
"name": "Amazing Alisha",
"age": 24,
"region": "Trinity Lutheran",
"pets": []
},
{
"_id": "65d91d857b2e523b16d3577b",
"name": "Phenomenal Pavan",
"age": 25,
"region": "Camine",
"pets": [
{
"isActive": true,
"animal": "small dog",
"vet": true,
"food": "Friskies",
"lbs": 5
},
{
"isActive": false,
"animal": "cat",
"vet": false,
"food": "Nutrena",
"lbs": 2
}
]
},
{
"_id": "65d91d857b2e523b16d3577c",
"name": "Intricate Ismaeel",
"age": 25,
"region": "Camine",
"pets": []
},
{
"_id": "65d91d857b2e523b16d3577d",
"name": "Jolly Joanne",
"age": 31,
"region": "Lockhart",
"pets": []
},
{
"_id": "65d91d857b2e523b16d3577e",
"name": "Superb Sai",
"age": 28,
"region": "McMahan",
"pets": []
},
{
"_id": "65d91d857b2e523b16d3577f",
"name": "Magical Mi Lan",
"age": 38,
"region": "Trinity Lutheran",
"pets": []
},
{
"_id": "65d91d857b2e523b16d35780",
"name": "Observant Omri",
"age": 31,
"region": "Flatonia",
"pets": []
},
{
"_id": "65d91d857b2e523b16d35781",
"name": "Meticulous Matthew",
"age": 420,
"region": "Trinity Lutheran",
"pets": []
},
{
"_id": "65d91d857b2e523b16d35782",
"name": "Terrific Tiffany",
"age": 90,
"region": "Elgin",
"pets": []
}
];




Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/home/InfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const InfoCard: FC<InfoCardProps> = ({
{description ? (
<>
<div className="mt-4 flex h-16 w-16 items-center justify-center rounded-full bg-white">
<img src={iconPath} />
<img alt= "icon" src={iconPath} />
</div>
<div
className={`mt-4 flex flex-col items-center justify-center`}
Expand All @@ -42,7 +42,7 @@ export const InfoCard: FC<InfoCardProps> = ({
{title}
</h2>
<div className="mt-4 flex h-16 w-16 items-center justify-center rounded-full bg-white">
<img src={iconPath} />
<img alt="icon" src={iconPath} />
</div>
</>
)}
Expand Down

0 comments on commit e0416bc

Please sign in to comment.