-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
303d054
commit f4bdefb
Showing
9 changed files
with
353 additions
and
102 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react"; | ||
|
||
import type { RootState } from "~/app/store"; | ||
import { selectToken } from "~/features/auth"; | ||
|
||
import { addCommonHeaders } from "./CommonHeaders"; | ||
|
||
// Uses the code splitting pattern. New endpoints should be injected into this base API | ||
// which itself has an empty endpoint object. | ||
export const baseApi = createApi({ | ||
reducerPath: "baseApi", | ||
baseQuery: fetchBaseQuery({ | ||
baseUrl: process.env.NEXT_PUBLIC_FIDESCTL_API, | ||
prepareHeaders: (headers, { getState }) => { | ||
const token: string | null = selectToken(getState() as RootState); | ||
addCommonHeaders(headers, token); | ||
return headers; | ||
}, | ||
}), | ||
tagTypes: ["DatastoreConnection", "Dataset", "Datasets"], | ||
endpoints: () => ({}), | ||
}); |
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
Oops, something went wrong.