Przeglądaj źródła

fix: send a storage path, not a full URL, for cover_url

The blog tightened validation on /api/posts: cover_url must be a bare
storage path such as /storage/media/2026/photo.png, not a full URL.
Create Post always built baseUrl + /storage/media/mediaPath, so every
publish since the change started failing with a 422. Drop the baseUrl
prefix and keep the same mediaPath, which is also where Upload Image
already puts the file. Workflow Output's own coverUrl stays a full URL
since it is informational for a human reader, not a value the blog
validates.

Verified with a real draft post (ok, 201) through the published
workflow.
fszontagh 1 miesiąc temu
rodzic
commit
bd3d78614b

+ 4 - 1
deploy/workflows/swf-zsebhoki-publish-anime-post.json

@@ -215,6 +215,7 @@
         "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36",
         "downloadCollection": "downloads",
         "downloadTtlHours": 24,
+        "failOnErrorStatus": true,
         "followRedirects": true,
         "method": "POST",
         "responseMode": "json",
@@ -237,11 +238,12 @@
     {
       "config": {
         "authType": "credential",
-        "body": "{\n  \"slug\": \"{{$node['Prepare'].slug}}\",\n  \"is_adult\": {{Number($node['Workflow Input'].is_adult) === 1 ? 1 : 0}},\n  \"title_hu\": \"{{$node['Workflow Input'].title_hu}}\",\n  \"title_en\": \"{{$node['Workflow Input'].title_en}}\",\n  \"content_hu\": \"{{$node['Workflow Input'].content_hu}}\",\n  \"content_en\": \"{{$node['Workflow Input'].content_en}}\",\n  \"status\": \"{{$node['Workflow Input'].status || 'draft'}}\",\n  \"cover_url\": \"{{$node['Prepare'].baseUrl}}/storage/media/{{$node['Prepare'].mediaPath}}\",\n  \"cover_alt_hu\": \"{{$node['Workflow Input'].cover_alt_hu || $node['Workflow Input'].title_hu}}\",\n  \"cover_alt_en\": \"{{$node['Workflow Input'].cover_alt_en || $node['Workflow Input'].title_en}}\"\n}",
+        "body": "{\n  \"slug\": \"{{$node['Prepare'].slug}}\",\n  \"is_adult\": {{Number($node['Workflow Input'].is_adult) === 1 ? 1 : 0}},\n  \"title_hu\": \"{{$node['Workflow Input'].title_hu}}\",\n  \"title_en\": \"{{$node['Workflow Input'].title_en}}\",\n  \"content_hu\": \"{{$node['Workflow Input'].content_hu}}\",\n  \"content_en\": \"{{$node['Workflow Input'].content_en}}\",\n  \"status\": \"{{$node['Workflow Input'].status || 'draft'}}\",\n  \"cover_url\": \"/storage/media/{{$node['Prepare'].mediaPath}}\",\n  \"cover_alt_hu\": \"{{$node['Workflow Input'].cover_alt_hu || $node['Workflow Input'].title_hu}}\",\n  \"cover_alt_en\": \"{{$node['Workflow Input'].cover_alt_en || $node['Workflow Input'].title_en}}\"\n}",
         "contentType": "application/json",
         "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36",
         "downloadCollection": "downloads",
         "downloadTtlHours": 24,
+        "failOnErrorStatus": true,
         "followRedirects": true,
         "method": "POST",
         "responseMode": "json",
@@ -333,6 +335,7 @@
         "credentialId": "cred_c6b24bca-c3e9-4be5-a266-25ddc8538f36",
         "downloadCollection": "downloads",
         "downloadTtlHours": 24,
+        "failOnErrorStatus": true,
         "followRedirects": true,
         "method": "GET",
         "responseMode": "json",