From 1cb359e6cdc50a382acf8cddcf5a8c3d10984560 Mon Sep 17 00:00:00 2001 From: Tom Gobich Date: Sun, 15 Oct 2023 08:22:30 -0400 Subject: [PATCH] fixing preview route for blogs. allowing videos to be cleared on update --- app/Controllers/Http/PostsController.ts | 4 ++++ app/Models/Post.ts | 4 ++-- public/assets/entrypoints.json | 16 ++++++++-------- public/assets/manifest.json | 16 ++++++++-------- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/Controllers/Http/PostsController.ts b/app/Controllers/Http/PostsController.ts index b123375..6b42f29 100644 --- a/app/Controllers/Http/PostsController.ts +++ b/app/Controllers/Http/PostsController.ts @@ -135,6 +135,10 @@ export default class PostsController { post.merge({ ...data, publishAt }) + if (!data.videoBunnyId) post.videoBunnyId = null + if (!data.videoUrl) post.videoUrl = null + if (!data.videoBunnyId && !data.videoUrl) post.videoSeconds = 0 + await post.save() await AssetService.syncAssetTypes(assetIds, assetTypeIds, altTexts, credits) await PostService.syncAssets(post, syncAssetIds) diff --git a/app/Models/Post.ts b/app/Models/Post.ts index 87bf405..c55aa46 100644 --- a/app/Models/Post.ts +++ b/app/Models/Post.ts @@ -338,9 +338,9 @@ export default class Post extends AppBaseModel { switch (this.postTypeId) { case PostType.BLOG: - return `/posts/${this.slug}` + return `/blog/${this.slug}` case PostType.NEWS: - return `/news/${this.slug}` + return `/blog/${this.slug}` case PostType.LIVESTREAM: return `/streams/${this.slug}` case PostType.SNIPPET: diff --git a/public/assets/entrypoints.json b/public/assets/entrypoints.json index f7073a8..437f833 100644 --- a/public/assets/entrypoints.json +++ b/public/assets/entrypoints.json @@ -2,40 +2,40 @@ "entrypoints": { "app": { "css": [ - "http://localhost:60038/assets/app.css" + "http://localhost:64876/assets/app.css" ], "js": [ - "http://localhost:60038/assets/app.js" + "http://localhost:64876/assets/app.js" ] }, "post": { "js": [ - "http://localhost:60038/assets/post.js" + "http://localhost:64876/assets/post.js" ] }, "stream": { "js": [ - "http://localhost:60038/assets/stream.js" + "http://localhost:64876/assets/stream.js" ] }, "file_manager": { "js": [ - "http://localhost:60038/assets/file_manager.js" + "http://localhost:64876/assets/file_manager.js" ] }, "tiptap_basic": { "js": [ - "http://localhost:60038/assets/tiptap_basic.js" + "http://localhost:64876/assets/tiptap_basic.js" ] }, "studio.posts.editor": { "js": [ - "http://localhost:60038/assets/studio.posts.editor.js" + "http://localhost:64876/assets/studio.posts.editor.js" ] }, "studio.collections": { "js": [ - "http://localhost:60038/assets/studio.collections.js" + "http://localhost:64876/assets/studio.collections.js" ] } } diff --git a/public/assets/manifest.json b/public/assets/manifest.json index e651f9b..93085e1 100644 --- a/public/assets/manifest.json +++ b/public/assets/manifest.json @@ -1,10 +1,10 @@ { - "assets/app.css": "http://localhost:60038/assets/app.css", - "assets/app.js": "http://localhost:60038/assets/app.js", - "assets/post.js": "http://localhost:60038/assets/post.js", - "assets/stream.js": "http://localhost:60038/assets/stream.js", - "assets/file_manager.js": "http://localhost:60038/assets/file_manager.js", - "assets/tiptap_basic.js": "http://localhost:60038/assets/tiptap_basic.js", - "assets/studio.posts.editor.js": "http://localhost:60038/assets/studio.posts.editor.js", - "assets/studio.collections.js": "http://localhost:60038/assets/studio.collections.js" + "assets/app.css": "http://localhost:64876/assets/app.css", + "assets/app.js": "http://localhost:64876/assets/app.js", + "assets/post.js": "http://localhost:64876/assets/post.js", + "assets/stream.js": "http://localhost:64876/assets/stream.js", + "assets/file_manager.js": "http://localhost:64876/assets/file_manager.js", + "assets/tiptap_basic.js": "http://localhost:64876/assets/tiptap_basic.js", + "assets/studio.posts.editor.js": "http://localhost:64876/assets/studio.posts.editor.js", + "assets/studio.collections.js": "http://localhost:64876/assets/studio.collections.js" } \ No newline at end of file