Skip to content

Frontend/integrate available jobs - #164

Open
akprinciple wants to merge 12 commits into
artisyn-io:mainfrom
akprinciple:frontend/integrate-available-jobs
Open

Frontend/integrate available jobs#164
akprinciple wants to merge 12 commits into
artisyn-io:mainfrom
akprinciple:frontend/integrate-available-jobs

Conversation

@akprinciple

Copy link
Copy Markdown
Contributor

Title: feat(frontend): integrate available jobs tab with API

closes #84

Description

This PR replaces the hardcoded dummyjobs data with dynamic, API-powered job listings on the Artisan Dashboard and Available Jobs tab.

It introduces a new mock API endpoint to serve the data while removing local data dependencies from the frontend components. This sets up a clear path for future backend/database integration. Additionally, it fixes a minor race condition with the URL query parameters filtering inside the JobCard component.

Related User Story

As an artisan, I want to see live available jobs, so that I can apply to current opportunities.

Key Changes

  • API Route: Created a new GET endpoint at /api/jobs/listings to serve available jobs data.
  • Dashboard Overview (page.tsx): Updated the artisan dashboard to fetch available jobs from the new API instead of using the local mock file. Added proper loading and error states.
  • Available Jobs (JobCard.tsx):
    • Replaced the local dummyjobs import with a client-side fetch to /api/jobs/listings.
    • Added robust state management for loading, error, and activeFilters.
    • Fixed a race condition where URL-based filtering was being overwritten on the initial component mount.
  • Filters (JobFilters.tsx): Cleaned up filter interactions to synchronize correctly with the URL search parameters and the JobCard state.
  • Mock Data (dummyjobs.ts): Added unique id properties to the mock data interface so React can properly track list items by key.

Acceptance Criteria

  • No dummyjobs dependency remains in the available tab (JobCard.tsx / JobFilters.tsx).
  • Job data is successfully fetched from the API response (/api/jobs/listings).
  • Loading states and error handling are implemented during data fetches.

@Kaylahray Kaylahray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi please, @akprinciple resolve workflow

@akprinciple

Copy link
Copy Markdown
Contributor Author

Conflict resolve @Kaylahray

@akprinciple
akprinciple requested a review from Kaylahray June 2, 2026 11:07
@akprinciple

Copy link
Copy Markdown
Contributor Author

@Kaylahray kindly merge now. The wave is ending soon

@Kaylahray

Copy link
Copy Markdown
Contributor

@akprinciple not to worry you'll still get your points if I merge, Please fix your both PRs ,conflict and workflow Please

@akprinciple

Copy link
Copy Markdown
Contributor Author

@Kaylahray Both PR has been looked into, Thank you

@Kaylahray

Copy link
Copy Markdown
Contributor

Hey I was going to merge regardless but now u hv conflics here, please also help me run pnpm lint and pnpm build when you're resolving it so you cn fix the workflow @akprinciple

@akprinciple

Copy link
Copy Markdown
Contributor Author

@Kaylahray Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API integrate available jobs tab

2 participants