diff options
| author | Max Nanis | 2026-09-29 11:47:48 -0700 |
|---|---|---|
| committer | Max Nanis | 2026-09-29 11:47:48 -0700 |
| commit | cd173e67e4e0514271371f4a5e5136f7f61d06d1 (patch) | |
| tree | 03d389b22cc02a4b1dd702eca0db1f13a43c4e3f /jb-ui/src/models/authAPI.ts | |
| parent | 08643310a783d4da5212ef419ee8d909f683f8e2 (diff) | |
| download | amt-jb-dev.tar.gz amt-jb-dev.zip | |
Redemption Modal. Redemption Magic flow. User Account Icondev
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; + +// |
