Update story route from /editor to /story and add redirect
This commit is contained in:
@@ -132,7 +132,7 @@ export default function StoriesPage() {
|
||||
{stories.map((story, index) => (
|
||||
<button
|
||||
key={story.id}
|
||||
onClick={() => router.push(`/editor/${story.slug}`)}
|
||||
onClick={() => router.push(`/story/${story.slug}`)}
|
||||
className={`opacity-0 animate-fade-in-up group relative glass-panel p-3 rounded-lg hover:shadow-indigo/20 hover:shadow-2xl transition-all duration-500 hover:scale-[1.05] hover:-translate-y-2 border border-border/50 hover:border-indigo/30 hover:bg-white/[0.02] backdrop-blur-sm focus:outline-none`}
|
||||
style={{ animationDelay: `${200 + index * 100}ms` }}
|
||||
>
|
||||
|
||||
@@ -168,7 +168,7 @@ export function ComicCreationForm({
|
||||
const result = await response.json();
|
||||
|
||||
// Redirect to the story editor using slug
|
||||
router.push(`/editor/${result.storySlug}`);
|
||||
router.push(`/story/${result.storySlug}`);
|
||||
} catch (error) {
|
||||
console.error("Error creating comic:", error);
|
||||
toast({
|
||||
|
||||
@@ -6,6 +6,15 @@ const nextConfig = {
|
||||
images: {
|
||||
unoptimized: true,
|
||||
},
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
source: '/editor/:slug*',
|
||||
destination: '/story/:slug*',
|
||||
permanent: true,
|
||||
},
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
export default nextConfig
|
||||
|
||||
Reference in New Issue
Block a user