diff --git a/components/DesktopSidebar/UserIcon.tsx b/components/DesktopSidebar/UserIcon.tsx index 5363d65..7909cb5 100644 --- a/components/DesktopSidebar/UserIcon.tsx +++ b/components/DesktopSidebar/UserIcon.tsx @@ -8,9 +8,10 @@ import { UserIconContainer, } from '@/styles/components/Sidebar/userIcon.styles'; import { Media } from '@/lib/media'; +import { QueriedUserData } from 'bookem-shared/src/types/database'; export const UserIcon = () => { - const [userData, setUserData] = useState(null); + const [userData, setUserData] = useState(null); const [error, setError] = useState(); useEffect(() => { diff --git a/pages/api/users/index.ts b/pages/api/users/index.ts index 27f13e0..a675e80 100644 --- a/pages/api/users/index.ts +++ b/pages/api/users/index.ts @@ -4,7 +4,7 @@ import dbConnect from '@/lib/dbConnect'; import { getSession } from 'next-auth/react'; import Users from 'bookem-shared/src/models/Users'; -import { UserData } from 'bookem-shared/src/types/database'; +import { QueriedUserData } from 'bookem-shared/src/types/database'; export default async function handler( req: NextApiRequest, @@ -27,7 +27,7 @@ export default async function handler( await dbConnect(); try { - const user = (await Users.findOne({ email: email })) as UserData; + const user = (await Users.findOne({ email: email })) as QueriedUserData; res.status(200).json(user); } catch (e) { console.error('An error has occurred in index.ts', e);