Skip to content

Conversation

@je-zhou
Copy link
Contributor

@je-zhou je-zhou commented Jan 25, 2025

Added the following params to the url endpoint

Example usecase

    const url = new URL(window.location.href + "/api/jobs");
    // Add Offset. e.g. Only want listings after the first 10
    url.searchParams.set("offset", "10");

    // Add Offset. e.g. Only want api to return a max of 100 listings
    url.searchParams.set("limit", "100");

    // By default the api will not return outdated listings, you can provide outdated = true to get outdated listings
    url.searchParams.set("outdated", "false");

    // Filter by working rights
    url.searchParams.set(
      "working_rights",
      "aus_citizen,other_rights,visa_sponsored",
    );

    // Filter by job types
    url.searchParams.set("types", "graduate,intern");

    // Filter by industry fields
    url.searchParams.set("industry_fields", "banks,tech");

    // Search for keyword in job title or company name
    url.searchParams.set("keyword", "developer");

    // Handle Reponse
    const response = await fetch(url.toString());

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const data = await response.json();

When filtering by working rights, job type, industry field you need to have these comma separated, without spaces. They are also case insensitive.

Note that you probably won't need to interact with the outdated param much because by default the api only returns listings with outdated=false

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-0dae88c00-17.eastasia.4.azurestaticapps.net

Copy link
Contributor

@jason301c jason301c left a comment

Choose a reason for hiding this comment

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

looks good to me !!

@jason301c jason301c merged commit 7d5b217 into development Jan 25, 2025
8 checks passed
@jason301c jason301c deleted the backend-endpoint branch January 25, 2025 12:47
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.

4 participants