throw if user not found
This commit is contained in:
@@ -39,7 +39,11 @@ export default function EditProfile({ profile }: EditProfileProps) {
|
|||||||
toast('Profile updated', {
|
toast('Profile updated', {
|
||||||
description: 'Your profile has been updated.',
|
description: 'Your profile has been updated.',
|
||||||
});
|
});
|
||||||
reset(res);
|
reset({
|
||||||
|
firstName: res.firstName ?? '',
|
||||||
|
lastName: res.lastName ?? '',
|
||||||
|
email: res.email,
|
||||||
|
});
|
||||||
router.refresh();
|
router.refresh();
|
||||||
},
|
},
|
||||||
onError: handleError,
|
onError: handleError,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export async function getCurrentUser() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getUserById(id: string) {
|
export async function getUserById(id: string) {
|
||||||
return db.user.findUnique({
|
return db.user.findUniqueOrThrow({
|
||||||
where: {
|
where: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user