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