Skip to content

Commit

Permalink
fixing preview route for blogs. allowing videos to be cleared on update
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgobich committed Oct 15, 2023
1 parent ead169c commit 1cb359e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
4 changes: 4 additions & 0 deletions app/Controllers/Http/PostsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 8 additions & 8 deletions public/assets/entrypoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
Expand Down
16 changes: 8 additions & 8 deletions public/assets/manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 1cb359e

Please sign in to comment.