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} +

))} diff --git a/frontend/src/Jobs.tsx b/frontend/src/Jobs.tsx index 9dc97c3..66c31dc 100644 --- a/frontend/src/Jobs.tsx +++ b/frontend/src/Jobs.tsx @@ -21,6 +21,7 @@ interface Location { address: string; city: string; country: string; + zipcode: string; } interface Pet { @@ -207,7 +208,10 @@ const Jobs: React.FC = () => {

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 = () => {
diff --git a/frontend/src/auth/AuthProvider.tsx b/frontend/src/auth/AuthProvider.tsx index e26a09d..0b85229 100644 --- a/frontend/src/auth/AuthProvider.tsx +++ b/frontend/src/auth/AuthProvider.tsx @@ -79,7 +79,8 @@ const AuthProvider = ({ children }: React.PropsWithChildren) => { .then((response) => { if (response.status === 201) { toast.success( - `An account has been created for ${response.data?.data?.email ?? "" + `An account has been created for ${ + response.data?.data?.email ?? "" }. Redirecting to login page...` ); navigate("/login"); diff --git a/furbaby/api/migrations/0015_alter_applications_status.py b/furbaby/api/migrations/0015_alter_applications_status.py index 0393957..d128b45 100644 --- a/furbaby/api/migrations/0015_alter_applications_status.py +++ b/furbaby/api/migrations/0015_alter_applications_status.py @@ -4,15 +4,14 @@ class Migration(migrations.Migration): - dependencies = [ - ('api', '0014_merge_20231127_1811'), + ("api", "0014_merge_20231127_1811"), ] operations = [ migrations.AlterField( - model_name='applications', - name='status', + model_name="applications", + name="status", field=models.TextField(null=True), ), ] diff --git a/furbaby/api/views.py b/furbaby/api/views.py index 16439e9..86b5e13 100644 --- a/furbaby/api/views.py +++ b/furbaby/api/views.py @@ -947,7 +947,7 @@ def post(self, request, *args, **kwargs): application_data = { "user": request.user.id, "job": job_id, - "status": "rejected", # You can set an initial status here + "status": None, # You can set an initial status here "details": {}, # You can add more details if needed } application_serializer = ApplicationSerializer(