-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue 2448] use v1 search endpoint and frontend fetch pattern refact…
…ors (#2518) * opportunity search change to use the `v1` version of the endpoint and activate the use of Open Search on the backend * various refactors to the `API` fetch system for general improvement and some minor bug fixes * fix to loading spinner test that was acting flaky * update e2e script to include seeding open search
- Loading branch information
1 parent
a0bc389
commit a90897d
Showing
15 changed files
with
433 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,21 @@ | ||
import "server-only"; | ||
|
||
import { environment } from "src/constants/environments"; | ||
import { OpportunityApiResponse } from "src/types/opportunity/opportunityResponseTypes"; | ||
|
||
import BaseApi from "./BaseApi"; | ||
|
||
export default class OpportunityListingAPI extends BaseApi { | ||
get version(): string { | ||
return "v1"; | ||
} | ||
|
||
get basePath(): string { | ||
return environment.API_URL; | ||
} | ||
|
||
get namespace(): string { | ||
return "opportunities"; | ||
} | ||
|
||
async getOpportunityById( | ||
opportunityId: number, | ||
): Promise<OpportunityApiResponse> { | ||
const subPath = `${opportunityId}`; | ||
const response = (await this.request( | ||
const response = await this.request<OpportunityApiResponse>( | ||
"GET", | ||
this.basePath, | ||
this.namespace, | ||
subPath, | ||
)) as OpportunityApiResponse; | ||
`${opportunityId}`, | ||
); | ||
return response; | ||
} | ||
} |
Oops, something went wrong.