feat(WEB-169): get profile data from API
This commit is contained in:
11
types/auth.d.ts
vendored
11
types/auth.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import "next-auth"
|
||||
import type { JWT } from "next-auth/jwt"
|
||||
|
||||
// Module augmentation
|
||||
// https://authjs.dev/getting-started/typescript#popular-interfaces-to-augment
|
||||
@@ -20,10 +20,7 @@ declare module "next-auth" {
|
||||
/**
|
||||
* Returned by `useSession`, `auth`, contains information about the active session.
|
||||
*/
|
||||
interface Session {}
|
||||
}
|
||||
|
||||
declare module "next-auth/jwt" {
|
||||
/** Returned by the `jwt` callback and `auth`, when using JWT sessions */
|
||||
interface JWT {}
|
||||
interface Session {
|
||||
token: JWT
|
||||
}
|
||||
}
|
||||
|
||||
6
types/components/myPages/myProfile/container.ts
Normal file
6
types/components/myPages/myProfile/container.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { CardProps } from "./card/card"
|
||||
import type { User } from "@/types/user"
|
||||
|
||||
export interface ContainerProps extends CardProps {
|
||||
user: User
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { User } from "@/types/user"
|
||||
|
||||
export interface ProfileProps extends React.HTMLAttributes<HTMLElement> {
|
||||
user: User
|
||||
}
|
||||
7
types/fetch.ts
Normal file
7
types/fetch.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface RequestOptionsWithJSONBody
|
||||
extends Omit<RequestInit, "body" | "method"> {
|
||||
body: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface RequestOptionsWithOutBody
|
||||
extends Omit<RequestInit, "body" | "method"> {}
|
||||
8
types/jwt.d.ts
vendored
Normal file
8
types/jwt.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Module augmentation
|
||||
// https://authjs.dev/getting-started/typescript#popular-interfaces-to-augment
|
||||
declare module "next-auth/jwt" {
|
||||
/** Returned by the `jwt` callback and `auth`, when using JWT sessions */
|
||||
interface JWT {
|
||||
access_token: string
|
||||
}
|
||||
}
|
||||
8
types/next/error.ts
Normal file
8
types/next/error.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
interface NextError extends Error {
|
||||
digest?: string
|
||||
}
|
||||
|
||||
export interface ErrorPage {
|
||||
error: NextError
|
||||
reset: () => void
|
||||
}
|
||||
@@ -24,16 +24,15 @@ type Victory = {
|
||||
title: string
|
||||
}
|
||||
|
||||
/**
|
||||
* All extended field needs to be added by API team to response or
|
||||
* we have to get the values from elsewhere
|
||||
*/
|
||||
export interface User extends z.infer<typeof getUserSchema> {
|
||||
country: string
|
||||
dob: string
|
||||
firstname: string
|
||||
firstName: string
|
||||
journeys: Journey[]
|
||||
lastname: string
|
||||
membershipId: number
|
||||
nights: number
|
||||
points: number
|
||||
qualifyingPoints: number
|
||||
shortcuts: ShortcutLink[]
|
||||
stays: Stay[]
|
||||
victories: Victory[]
|
||||
|
||||
Reference in New Issue
Block a user