finish session controller

This commit is contained in:
wancat committed 2024-02-22 20:10:03 +08:00
1 parent c0ec382510
commit fd543ed594
3 files changed
+88 -77

No files matched your search

+2 -2
View File
@@ -120,9 +120,9 @@ export async function isQuestUnlocked(
user: HydratedDocument<IUser>,
questId: string
): Promise<boolean> {
const userProfile = await UserProfile.findOne({ user: user._id })
const userProfile = await UserProfile.findOne({ user: user.id })
if (!userProfile) {
throw new Error(`UserProfile ${user._id} not found`)
throw new Error(`UserProfile ${user.id} not found`)
}
const quest = await Quest.findById(questId)
if (!quest) {