fix(blog): Anpassung der API-URL zur Ermittlung der Blog-ID

- Entfernen des Standardwerts für die API-Basis-URL, um die Konfiguration flexibler zu gestalten.
- Sicherstellung, dass die URL korrekt auf die Backend-API verweist.
This commit is contained in:
Torsten Schulz (local)
2025-09-03 09:27:58 +02:00
parent 9d06783e12
commit 4bfc4258ac

View File

@@ -55,7 +55,7 @@ export default {
if ((!id && this.$route.params.slug) || (id && isNaN(Number(id)))) {
const slug = this.$route.params.slug || this.$route.params.id;
// Resolve slug to id via backend resolver but keep slug URL
const res = await fetch(`${import.meta.env.VITE_API_BASE_URL || 'http://localhost:3001'}/api/blog/blogs/slug/${encodeURIComponent(slug)}/id`);
const res = await fetch(`${import.meta.env.VITE_API_BASE_URL || ''}/api/blog/blogs/slug/${encodeURIComponent(slug)}/id`);
if (res.ok) {
const { id: rid } = await res.json();
this.resolvedId = rid;