mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
chore: refactor
This commit is contained in:
@ -136,7 +136,7 @@ export const EditDocumentForm = ({
|
|||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
description: 'An error occurred while updating the general settings.',
|
description: 'An error occurred while updating the document settings.',
|
||||||
variant: 'destructive',
|
variant: 'destructive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ type IsRecipientAuthorizedOptions = {
|
|||||||
authOptions?: TDocumentAuthMethods;
|
authOptions?: TDocumentAuthMethods;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getRecipient = async (email: string) => {
|
const getUserByEmail = async (email: string) => {
|
||||||
return await prisma.user.findFirst({
|
return await prisma.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
email,
|
email,
|
||||||
@ -74,7 +74,7 @@ export const isRecipientAuthorized = async ({
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const recipientUser = await getRecipient(recipient.email);
|
const recipientUser = await getUserByEmail(recipient.email);
|
||||||
|
|
||||||
if (!recipientUser) {
|
if (!recipientUser) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user