- Added Blog and BlogPost models with necessary fields and relationships. - Created blogRouter for handling blog-related API endpoints including CRUD operations. - Developed BlogService for business logic related to blogs and posts, including sharing functionality. - Implemented API client methods for frontend to interact with blog-related endpoints. - Added internationalization support for blog-related text in English and German. - Created Vue components for blog editing, listing, and viewing, including a rich text editor for post content. - Enhanced user experience with form validations and dynamic visibility settings based on user input.
14 lines
836 B
JavaScript
14 lines
836 B
JavaScript
import BlogListView from '@/views/blog/BlogListView.vue';
|
|
import BlogView from '@/views/blog/BlogView.vue';
|
|
import BlogEditorView from '@/views/blog/BlogEditorView.vue';
|
|
|
|
export default [
|
|
{ path: '/blogs/create', name: 'BlogCreate', component: BlogEditorView, meta: { requiresAuth: true } },
|
|
{ path: '/blogs/:id/edit', name: 'BlogEdit', component: BlogEditorView, props: true, meta: { requiresAuth: true } },
|
|
// Slug-only route first so it doesn't get captured by the :id route
|
|
{ path: '/blogs/:slug', name: 'BlogSlug', component: BlogView, props: route => ({ slug: route.params.slug }) },
|
|
// Id-constrained route (numeric id only) with optional slug for canonical links
|
|
{ path: '/blogs/:id(\\d+)/:slug?', name: 'Blog', component: BlogView, props: true },
|
|
{ path: '/blogs', name: 'BlogList', component: BlogListView },
|
|
];
|