Fixed a few things lol
All checks were successful
Docker Deploy / build-and-push (push) Successful in 4m11s

This commit is contained in:
2026-01-17 22:19:10 -07:00
parent 0cd77677f2
commit 091766d6e4
10 changed files with 61 additions and 57 deletions

View File

@@ -294,18 +294,18 @@ export function createInvoiceDocument(props: InvoiceDocumentProps) {
let logoPath;
// Handle uploads directory which might be external to public/
if (organization.logoUrl.startsWith("/uploads/")) {
let uploadDir;
const envRootDir = process.env.ROOT_DIR
? process.env.ROOT_DIR
: import.meta.env.ROOT_DIR;
const dataDir = process.env.DATA_DIR
? process.env.DATA_DIR
: import.meta.env.DATA_DIR;
if (envRootDir) {
uploadDir = join(envRootDir, "uploads");
} else {
uploadDir =
process.env.UPLOAD_DIR ||
join(process.cwd(), "public", "uploads");
if (!dataDir) {
throw new Error(
"DATA_DIR environment variable is not set",
);
}
const uploadDir = join(dataDir, "uploads");
const filename = organization.logoUrl.replace(
"/uploads/",
"",