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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user