Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

chore: prettier format

Marc Seitzf68d22a3383b
diff --git a/lib/emails/send-viewed-document.ts b/lib/emails/send-viewed-document.ts
index 3d836c17..5c9def64 100644
--- a/lib/emails/send-viewed-document.ts
+++ b/lib/emails/send-viewed-document.ts
@@ -1,12 +1,17 @@
import { sendEmail } from "@/lib/resend";
import ViewedDocumentEmail from "@/components/emails/viewed-document";
-export const sendViewedDocumentEmail = async (
- email: string,
- documentId: string,
- documentName: string,
- viewerEmail: string | null,
-) => {
+export const sendViewedDocumentEmail = async ({
+ email,
+ documentId,
+ documentName,
+ viewerEmail,
+}: {
+ email: string;
+ documentId: string;
+ documentName: string;
+ viewerEmail: string | null;
+}) => {
const emailTemplate = ViewedDocumentEmail({
documentId,
documentName,
diff --git a/lib/swr/use-link.ts b/lib/swr/use-link.ts
index b7616319..1fb36344 100644
--- a/lib/swr/use-link.ts
+++ b/lib/swr/use-link.ts
@@ -17,7 +17,7 @@ export function useLink() {
fetcher,
{
dedupingInterval: 10000,
- }
+ },
);
return {
@@ -36,11 +36,15 @@ export function useDomainLink() {
};
const { data: link, error } = useSWR<LinkWithDocument>(
- domain && slug && `/api/links/domains/${encodeURIComponent(domain)}/${encodeURIComponent(slug)}`,
+ domain &&
+ slug &&
+ `/api/links/domains/${encodeURIComponent(domain)}/${encodeURIComponent(
+ slug,
+ )}`,
fetcher,
{
dedupingInterval: 10000,
- }
+ },
);
return {
@@ -58,15 +62,13 @@ interface ViewWithDuration extends View {
completionRate: number;
}
-
export function useLinkVisits(linkId: string) {
-
const { data: views, error } = useSWR<ViewWithDuration[]>(
linkId && `/api/links/${encodeURIComponent(linkId)}/visits`,
fetcher,
{
dedupingInterval: 10000,
- }
+ },
);
return {
@@ -74,4 +76,4 @@ export function useLinkVisits(linkId: string) {
loading: !error && !views,
error,
};
-}
\ No newline at end of file
+}
diff --git a/pages/api/mupdf/convert-page.ts b/pages/api/mupdf/convert-page.ts
index 710ea302..50f48ee7 100644
--- a/pages/api/mupdf/convert-page.ts
+++ b/pages/api/mupdf/convert-page.ts
@@ -6,7 +6,7 @@ import prisma from "@/lib/prisma";
// This function can run for a maximum of 60 seconds
export const config = {
- maxDuration: 60,
+ maxDuration: 120,
};
export default async (req: NextApiRequest, res: NextApiResponse) => {
@@ -20,7 +20,7 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
const { documentVersionId, pageNumber, url } = req.body as {
documentVersionId: string;
pageNumber: number;
- url: string;
+ url: string;
};
// Fetch the PDF data
@@ -30,11 +30,11 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
// Create a MuPDF instance
var doc = mupdf.Document.openDocument(pdfData, "application/pdf");
- var page = doc.loadPage(pageNumber-1); // 0-based page index
+ var page = doc.loadPage(pageNumber - 1); // 0-based page index
var pixmap = page.toPixmap(
// mupdf.Matrix.identity,
- [3,0,0,3,0,0], // scale 3x
- mupdf.ColorSpace.DeviceRGB
+ [3, 0, 0, 3, 0, 0], // scale 3x
+ mupdf.ColorSpace.DeviceRGB,
);
var pngBuffer = pixmap.asPNG();
const blob = await put(`page-${pageNumber}.png`, pngBuffer, {
@@ -42,7 +42,9 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
});
if (!blob) {
- res.status(500).json({ error: `Failed to upload document page ${pageNumber}` });
+ res
+ .status(500)
+ .json({ error: `Failed to upload document page ${pageNumber}` });
return;
}