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

@@ -67,20 +67,16 @@ export const POST: APIRoute = async ({ request, locals, redirect }) => {
const ext = logo.name.split(".").pop() || "png";
const filename = `${organizationId}-${Date.now()}.${ext}`;
let uploadDir;
const dataDir = process.env.DATA_DIR
? process.env.DATA_DIR
: import.meta.env.DATA_DIR;
const envRootDir = process.env.ROOT_DIR
? process.env.ROOT_DIR
: import.meta.env.ROOT_DIR;
if (envRootDir) {
uploadDir = path.join(envRootDir, "uploads");
} else {
uploadDir =
process.env.UPLOAD_DIR ||
path.join(process.cwd(), "public", "uploads");
if (!dataDir) {
throw new Error("DATA_DIR environment variable is not set");
}
const uploadDir = path.join(dataDir, "uploads");
try {
await fs.access(uploadDir);
} catch {

View File

@@ -220,7 +220,7 @@ const isDraft = invoice.status === 'draft';
<!-- Items Table -->
<div class="mb-8">
<div class="overflow-x-auto">
<table class="w-full min-w-[600px]">
<table class="w-full min-w-150">
<thead>
<tr class="border-b-2 border-base-200 text-left text-xs font-bold uppercase tracking-wider text-base-content/40">
<th class="py-3">Description</th>

View File

@@ -163,7 +163,7 @@ const getStatusColor = (status: string) => {
<div role="button" tabindex="0" class="btn btn-ghost btn-sm btn-square">
<Icon name="heroicons:ellipsis-vertical" class="w-5 h-5" />
</div>
<ul tabindex="0" class="dropdown-content menu p-2 shadow-lg bg-base-100 rounded-box w-52 border border-base-200 z-[100]">
<ul tabindex="0" class="dropdown-content menu p-2 shadow-lg bg-base-100 rounded-box w-52 border border-base-200 z-100">
<li>
<a href={`/dashboard/invoices/${invoice.id}`}>
<Icon name="heroicons:eye" class="w-4 h-4" />

View File

@@ -9,19 +9,18 @@ export const GET: APIRoute = async ({ params }) => {
return new Response("Not found", { status: 404 });
}
let uploadDir;
const dataDir = process.env.DATA_DIR
? process.env.DATA_DIR
: import.meta.env.DATA_DIR;
const envRootDir = process.env.ROOT_DIR
? process.env.ROOT_DIR
: import.meta.env.ROOT_DIR;
if (envRootDir) {
uploadDir = path.join(envRootDir, "uploads");
} else {
uploadDir =
process.env.UPLOAD_DIR || path.join(process.cwd(), "public", "uploads");
if (!dataDir) {
return new Response("DATA_DIR environment variable is not set", {
status: 500,
});
}
const uploadDir = path.join(dataDir, "uploads");
const safePath = path.normalize(filePathParam).replace(/^(\.\.[\/\\])+/, "");
const fullPath = path.join(uploadDir, safePath);