diff --git a/frontend/src/Dashboard.tsx b/frontend/src/Dashboard.tsx index 8531e12..2449be4 100644 --- a/frontend/src/Dashboard.tsx +++ b/frontend/src/Dashboard.tsx @@ -35,6 +35,7 @@ interface Location { address: string; city: string; country: string; + zipcode: string; } interface Application { @@ -111,12 +112,13 @@ const Dashboard = () => { const jobDetailsResponse = await axios.get(API_ROUTES.JOBS, { params: { id: myApplications.job }, }); - const locationDetailsResponse = await axios.get(`${API_ROUTES.USER.LOCATION}`); - const locationDetail = locationDetailsResponse.data; - - //console.log("job details response", jobDetailsResponse.data); const jobDetail = jobDetailsResponse.data; + const locationDetailsResponse = await axios.get( + `${API_ROUTES.USER.LOCATION}?location_id=${jobDetail.location}` + ); + const locationDetail = locationDetailsResponse.data; + const petDetailsResponse = await axios.get(`${API_ROUTES.PETS}${jobDetail.pet}`); const petDetail = petDetailsResponse.data; @@ -208,7 +210,10 @@ const Dashboard = () => {
Pet Name: {job.pet.name}
Job Status: {job.status}
-Location: {job?.location?.address ?? ""}
++ Location: {job?.location?.address ?? ""}, {job?.location?.city ?? ""},{" "} + {job?.location?.zipcode ?? ""} +
Pay: ${job.pay}
Start: {job.start}
End: {job.end}
@@ -240,11 +245,19 @@ const Dashboard = () => { className="border border-gray-300 mb-4 p-4 rounded-md" >Application Status: {myApplications.status}
-Pet:{myApplications.pet.name}
-Start:{myApplications.job.start}
-End:{myApplications.job.end}
-Pay:{myApplications.job.pay}
+Pet Name : {myApplications.pet.name}
++ Location: {myApplications?.location?.address ?? ""},{" "} + {myApplications?.location?.city ?? ""},{" "} + {myApplications?.location?.zipcode ?? ""} +
+Pay: ${myApplications.job.pay}
+Start: {myApplications.job.start}
+End: {myApplications.job.end}
++ Application Status:{" "} + {!myApplications.status ? "No Decision" : myApplications.status} +
Pet Name: {job.pet.name}
Status: {job.status}
-Location: {job?.location?.address ?? ""}
++ Location: {job?.location?.address ?? ""}, {job?.location?.city ?? ""},{" "} + {job?.location?.zipcode ?? ""} +
Pay: {job.pay}
Start: {job.start}
End: {job.end}
@@ -215,7 +219,7 @@ const Jobs: React.FC = () => {