fix token resolve

This commit is contained in:
Primakov Alexandr Alexandrovich 2024-02-29 22:16:57 +03:00
parent 80713f7e0f
commit ff1f8e0452

View File

@ -9,9 +9,11 @@ export const api = createApi({
baseQuery: fetchBaseQuery({ baseQuery: fetchBaseQuery({
baseUrl: getConfigValue("journal.back.url"), baseUrl: getConfigValue("journal.back.url"),
headers: { headers: {
Authorization: `Bearer ${keycloak.token}`,
"Content-Type": "application/json;charset=utf-8", "Content-Type": "application/json;charset=utf-8",
}, },
prepareHeaders: (headers) => {
headers.set('Authorization', `Bearer ${keycloak.token}`)
}
}), }),
endpoints: (builder) => ({ endpoints: (builder) => ({
lessonList: builder.query<BaseResponse<Lesson[]>, void>({ lessonList: builder.query<BaseResponse<Lesson[]>, void>({