Refactor API client and stock management logic for improved clarity, error handling, and support for additional stock types.

This commit is contained in:
2026-04-06 10:30:37 +02:00
parent 929ee6557a
commit 155c7a65d6
8 changed files with 364 additions and 103 deletions
+5 -1
View File
@@ -18,7 +18,10 @@ export function renderSettingsPage() {
<form class="vstack gap-3" @submit.prevent="save()">
<div>
<label class="form-label">Tryton server URL</label>
<input class="form-control" type="url" x-model="form.baseUrl" required />
<input class="form-control" type="url" x-model="form.baseUrl" />
<div class="form-text">
Leave empty to use the same origin as this deployed Lonc frontend.
</div>
</div>
<div>
<label class="form-label">Database name</label>
@@ -36,6 +39,7 @@ export function renderSettingsPage() {
<h2 class="h5">Integration notes</h2>
<ul class="text-body-secondary small ps-3 mb-0">
<li>Connection uses Tryton user application keys for the <code>kitchen</code> application.</li>
<li>Leaving the server URL empty makes API calls use same-origin relative paths.</li>
<li>Kitchen-scoped requests are built as <code>/{database}/kitchen/{kitchenId}/...</code>.</li>
<li>Label preview accepts image blobs, image URLs, or SVG payloads.</li>
</ul>