Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

fix(posts): align Index/Calendar routing with Failed→show redirect

Paulo Castellano31db72638b72
diff --git a/resources/js/components/posts/editor/PostEditorHeader.vue b/resources/js/components/posts/editor/PostEditorHeader.vue
index d673d8416..82c3b3bb2 100644
--- a/resources/js/components/posts/editor/PostEditorHeader.vue
+++ b/resources/js/components/posts/editor/PostEditorHeader.vue
@@ -28,7 +28,7 @@ const emit = defineEmits<{
(e: 'submit', status: string): void;
}>();
-const READONLY_STATUSES: readonly string[] = [PostStatus.Publishing, PostStatus.Published, PostStatus.PartiallyPublished];
+const READONLY_STATUSES: readonly string[] = [PostStatus.Publishing, PostStatus.Published, PostStatus.PartiallyPublished, PostStatus.Failed];
const PUBLISHED_STATUSES: readonly string[] = [PostStatus.Published, PostStatus.PartiallyPublished];
const isReadOnly = computed(() => READONLY_STATUSES.includes(props.post.status));
@@ -125,7 +125,7 @@ const isPublished = computed(() => PUBLISHED_STATUSES.includes(props.post.status
type="button"
:disabled="isPostActionDisabled"
:title="postActionTooltip"
- @click="emit('submit', hasPickedTime ? 'scheduled' : 'publishing')"
+ @click="emit('submit', hasPickedTime ? PostStatus.Scheduled : PostStatus.Publishing)"
>
{{ hasPickedTime ? $t('posts.edit.schedule') : $t('posts.edit.post_now') }}
</Button>
diff --git a/resources/js/pages/posts/Calendar.vue b/resources/js/pages/posts/Calendar.vue
index 791c144ec..1d93b385b 100644
--- a/resources/js/pages/posts/Calendar.vue
+++ b/resources/js/pages/posts/Calendar.vue
@@ -13,6 +13,7 @@ import dayjs from '@/dayjs';
import AppLayout from '@/layouts/AppLayout.vue';
import { calendar } from '@/routes/app';
import { create as createPost, edit as editPost, show as showPost } from '@/routes/app/posts';
+import { PostStatus } from '@/types/post';
interface PostPlatform {
id: string;
@@ -230,8 +231,10 @@ const getStatusColor = (status: string): string => {
return colors[status] ?? colors.draft;
};
+const EDITABLE_STATUSES: readonly string[] = [PostStatus.Draft, PostStatus.Scheduled];
+
const getPostUrl = (post: Post): string => {
- return ['draft', 'scheduled', 'failed'].includes(post.status)
+ return EDITABLE_STATUSES.includes(post.status)
? editPost.url(post.id)
: showPost.url(post.id);
};
diff --git a/resources/js/pages/posts/Edit.vue b/resources/js/pages/posts/Edit.vue
index f6568d5ea..d312cab1f 100644
--- a/resources/js/pages/posts/Edit.vue
+++ b/resources/js/pages/posts/Edit.vue
@@ -221,7 +221,9 @@ const getMediaIncompatibilityReason = (contentType: string, mediaItems: MediaIte
const PLATFORM_VARIANTS: Record<string, string[]> = {
[Platform.Facebook]: [ContentType.FacebookPost, ContentType.FacebookReel, ContentType.FacebookStory],
[Platform.Instagram]: [ContentType.InstagramFeed, ContentType.InstagramReel, ContentType.InstagramStory],
- [Platform.LinkedIn]: [ContentType.LinkedInPost, ContentType.LinkedInCarousel, ContentType.LinkedInPagePost, ContentType.LinkedInPageCarousel],
+ [Platform.InstagramFacebook]: [ContentType.InstagramFeed, ContentType.InstagramReel, ContentType.InstagramStory],
+ [Platform.LinkedIn]: [ContentType.LinkedInPost, ContentType.LinkedInCarousel],
+ [Platform.LinkedInPage]: [ContentType.LinkedInPagePost, ContentType.LinkedInPageCarousel],
[Platform.TikTok]: [ContentType.TikTokVideo, ContentType.TikTokPhoto],
[Platform.Pinterest]: [ContentType.PinterestPin, ContentType.PinterestVideoPin, ContentType.PinterestCarousel],
};
diff --git a/resources/js/pages/posts/Index.vue b/resources/js/pages/posts/Index.vue
index f81a4fbe7..ad70d20b2 100644
--- a/resources/js/pages/posts/Index.vue
+++ b/resources/js/pages/posts/Index.vue
@@ -37,6 +37,7 @@ import dayjs from '@/dayjs';
import debounce from '@/debounce';
import AppLayout from '@/layouts/AppLayout.vue';
import { copyToClipboard } from '@/lib/utils';
+import { PostStatus } from '@/types/post';
interface SocialAccount {
id: string;
platform: string;
@@ -136,7 +137,8 @@ const getEnabledPlatforms = (post: Post) => post.post_platforms.filter((pp) => p
const getPostPreview = (post: Post): string =>
post.content?.trim() || trans('calendar.no_content');
-const canEdit = (post: Post): boolean => ['draft', 'scheduled', 'failed'].includes(post.status);
+const EDITABLE_STATUSES: readonly string[] = [PostStatus.Draft, PostStatus.Scheduled];
+const canEdit = (post: Post): boolean => EDITABLE_STATUSES.includes(post.status);
const postUrl = (post: Post): string =>
canEdit(post) ? editPost.url(post.id) : showPost.url(post.id);