chore: changes based on review

This commit is contained in:
Ephraim Atta-Duncan
2024-10-18 01:12:43 +00:00
parent 2a098f89fa
commit 4348a949dd
3 changed files with 11 additions and 11 deletions

View File

@ -31,7 +31,7 @@ export const selfSignDocument = async ({
},
});
const document = await prisma.document.findUnique({
const document = await prisma.document.findFirstOrThrow({
where: {
id: documentId,
userId,
@ -64,7 +64,7 @@ export const selfSignDocument = async ({
const { documentData } = document;
if (!documentData.data) {
if (!documentData || !documentData.data) {
throw new Error('Document data not found');
}