init
This commit is contained in:
48
src/__data__/api/api.ts
Normal file
48
src/__data__/api/api.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
|
||||
import { getConfigValue } from "@ijl/cli";
|
||||
|
||||
import { keycloak } from "../kc";
|
||||
|
||||
export const api = createApi({
|
||||
reducerPath: "auth",
|
||||
baseQuery: fetchBaseQuery({
|
||||
baseUrl: getConfigValue("journal.back.url"),
|
||||
headers: {
|
||||
Authorization: `Bearer ${keycloak.token}`,
|
||||
"Content-Type": "application/json;charset=utf-8",
|
||||
},
|
||||
}),
|
||||
endpoints: (builder) => ({
|
||||
lessonList: builder.query({
|
||||
query: () => '/lesson/list'
|
||||
})
|
||||
// signIn: builder.mutation<SignInResponce, SignInRequestBody>({
|
||||
// query: ({ login, password }) => ({
|
||||
// url: URLs.queryApi.login,
|
||||
// method: 'POST',
|
||||
// body: { login, password },
|
||||
// }),
|
||||
// }),
|
||||
// recoverPassword: builder.mutation<{ error?: string }, { email: string }>({
|
||||
// query: ({ email }) => ({
|
||||
// url: URLs.queryApi.revoverPassword,
|
||||
// method: 'POST',
|
||||
// body: { email }
|
||||
// })
|
||||
// }),
|
||||
// recoverPasswordConfirm: builder.mutation<{ error?: string }, { code: string }>({
|
||||
// query: ({ code }) => ({
|
||||
// url: URLs.queryApi.revoverPasswordConfirm,
|
||||
// method: 'POST',
|
||||
// body: { code }
|
||||
// })
|
||||
// }),
|
||||
// recoverPasswordNewPassword: builder.mutation<{ error?: string }, { newPassword: string }>({
|
||||
// query: ({ newPassword }) => ({
|
||||
// url: URLs.queryApi.revoverPasswordNew,
|
||||
// method: 'POST',
|
||||
// body: { newPassword }
|
||||
// })
|
||||
// })
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user