Update new.astro
All checks were successful
Docker Deploy / build-and-push (push) Successful in 4m9s

This commit is contained in:
2026-01-20 12:59:32 -07:00
parent 8b91ec7a71
commit e2949a28ef

View File

@@ -2,7 +2,7 @@
import DashboardLayout from '../../../layouts/DashboardLayout.astro'; import DashboardLayout from '../../../layouts/DashboardLayout.astro';
import { Icon } from 'astro-icon/components'; import { Icon } from 'astro-icon/components';
import { db } from '../../../db'; import { db } from '../../../db';
import { clients, members, invoices } from '../../../db/schema'; import { clients, members, invoices, organizations } from '../../../db/schema';
import { eq, desc, and } from 'drizzle-orm'; import { eq, desc, and } from 'drizzle-orm';
const user = Astro.locals.user; const user = Astro.locals.user;
@@ -25,6 +25,11 @@ const userMembership = currentTeamId
const currentTeamIdResolved = userMembership.organizationId; const currentTeamIdResolved = userMembership.organizationId;
const currentOrganization = await db.select()
.from(organizations)
.where(eq(organizations.id, currentTeamIdResolved))
.get();
// Fetch clients for dropdown // Fetch clients for dropdown
const teamClients = await db.select() const teamClients = await db.select()
.from(clients) .from(clients)
@@ -190,11 +195,11 @@ const defaultDueDate = nextMonth.toISOString().split('T')[0];
Currency Currency
</label> </label>
<select id="invoice-currency" name="currency" class="select select-bordered w-full"> <select id="invoice-currency" name="currency" class="select select-bordered w-full">
<option value="USD">USD ($)</option> <option value="USD" selected={currentOrganization?.defaultCurrency === 'USD'}>USD ($)</option>
<option value="EUR">EUR (€)</option> <option value="EUR" selected={currentOrganization?.defaultCurrency === 'EUR'}>EUR (€)</option>
<option value="GBP">GBP (£)</option> <option value="GBP" selected={currentOrganization?.defaultCurrency === 'GBP'}>GBP (£)</option>
<option value="CAD">CAD ($)</option> <option value="CAD" selected={currentOrganization?.defaultCurrency === 'CAD'}>CAD ($)</option>
<option value="AUD">AUD ($)</option> <option value="AUD" selected={currentOrganization?.defaultCurrency === 'AUD'}>AUD ($)</option>
</select> </select>
</div> </div>
</div> </div>