editing a story goes to detail view

This commit is contained in:
Stefan Hardegger
2025-10-31 09:13:25 +01:00
parent 715fb4e48a
commit 7a4dd567dc

View File

@@ -186,13 +186,13 @@ export default function EditStoryPage() {
}; };
const updatedStory = await storyApi.updateStory(storyId, updateData); const updatedStory = await storyApi.updateStory(storyId, updateData);
// If there's a new cover image, upload it separately // If there's a new cover image, upload it separately
if (coverImage) { if (coverImage) {
await storyApi.uploadCover(storyId, coverImage); await storyApi.uploadCover(storyId, coverImage);
} }
router.push(`/stories/${storyId}`); router.push(`/stories/${storyId}/detail`);
} catch (error: any) { } catch (error: any) {
console.error('Failed to update story:', error); console.error('Failed to update story:', error);
const errorMessage = error.response?.data?.message || 'Failed to update story'; const errorMessage = error.response?.data?.message || 'Failed to update story';