Files
avtoambor/src/routes/invoices/[id]/+page.server.js
David Beccue 00ee9fb1fe Add multi-line sale builder with pending-draft safeguard
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 12:57:49 +05:00

11 lines
289 B
JavaScript

import { error } from '@sveltejs/kit';
import { getInvoice } from '$lib/server/invoices.js';
export function load({ params }) {
const result = getInvoice(params.id);
if (!result || result.invoice.status !== 'saved') {
throw error(404, 'Invoice not found');
}
return result;
}