diff options
| author | Max Nanis | 2026-09-29 18:53:10 +0000 |
|---|---|---|
| committer | Max Nanis | 2026-09-29 18:53:10 +0000 |
| commit | 3e7eb6ca784bc062bd1c7129e40b8705543d8469 (patch) | |
| tree | 30bc2883ab3397f290fb494fd38b96d47ac701b9 /jb-ui/src/models/authAPI.ts | |
| parent | d43e82fd2c799410b15706d10dbbcaa838325a4d (diff) | |
| parent | cd173e67e4e0514271371f4a5e5136f7f61d06d1 (diff) | |
| download | amt-jb-3e7eb6ca784bc062bd1c7129e40b8705543d8469.tar.gz amt-jb-3e7eb6ca784bc062bd1c7129e40b8705543d8469.zip | |
Merges pull request #6
Redemption Modal. Redemption Magic flow. User Account Icon
Diffstat (limited to 'jb-ui/src/models/authAPI.ts')
| -rw-r--r-- | jb-ui/src/models/authAPI.ts | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/jb-ui/src/models/authAPI.ts b/jb-ui/src/models/authAPI.ts index 2964d55..a3efbcb 100644 --- a/jb-ui/src/models/authAPI.ts +++ b/jb-ui/src/models/authAPI.ts @@ -1,5 +1,13 @@ import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react"; import type { User } from "@/types/authApi"; +export const bpuid = import.meta.env.VITE_BPUID; + +// const DEV_USER: User = { +// blocked: false, +// display_name: null, +// email: "demo@jamesbillings67.com", +// product_user_id: import.meta.env.VITE_BPUID, +// }; export const authApi = createApi({ reducerPath: "authApi", @@ -10,7 +18,16 @@ export const authApi = createApi({ tagTypes: ["User"], endpoints: (builder) => ({ getMe: builder.query<User, void>({ - query: () => "/session/", + queryFn: async (_arg, _api, _extra, baseQuery) => { + // if (import.meta.env.DEV) { + // return { data: DEV_USER }; + // } + const result = await baseQuery("/session/"); + return result.data + ? { data: result.data as User } + : { error: result.error! }; + }, + providesTags: ["User"], }), // logout: builder.mutation({ @@ -22,3 +39,5 @@ export const authApi = createApi({ // export const { useGetMeQuery, useLogoutMutation } = authApi; export const { useGetMeQuery } = authApi; + +// |
