Skip to content

Commit

Permalink
Fix bug with SelfUserService#getInfo type
Browse files Browse the repository at this point in the history
  • Loading branch information
bombies committed Oct 26, 2023
1 parent 786f674 commit 9d8ed04
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/(site)/components/UserProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {FC} from "react";
import {Avatar, Dropdown, DropdownItem, DropdownMenu, DropdownSection, DropdownTrigger} from "@nextui-org/react";
import {signOut, useSession} from "next-auth/react";
import {signOut} from "next-auth/react";
import DashboardIcon from "@/app/(site)/components/icons/DashboardIcon";
import SettingsIcon from "@/app/(site)/components/icons/SettingsIcon";
import useMemberInfo from "@/app/(site)/hooks/useMemberInfo";
Expand Down
2 changes: 1 addition & 1 deletion src/app/(site)/hooks/useMemberInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Member} from "@prisma/client";

const useMemberInfo = () => {
const {status: sessionStatus} = useSession()
const {data} = useSWR(sessionStatus === 'authenticated' && '/api/me', fetcher<Member>)
const {data} = useSWR(sessionStatus === 'authenticated' && '/api/me', fetcher<Member | null>)
return data
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/api/me/self-user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import prisma from "@/libs/prisma";

class SelfUserService {

public async getInfo(session: Session): Promise<NextResponse<Member | undefined>> {
public async getInfo(session: Session): Promise<NextResponse<Member | null>> {
if (!session.user)
return buildResponse({
status: 403,
Expand Down

0 comments on commit 9d8ed04

Please sign in to comment.