Blog Management System - Integration Guide
The Blog Management System allows Malet Owners to create, edit, and manage their blog posts directly from their Malet (Outlet).
Key Features
Management Dashboard
- Access: Accessible via the "Manage" button on the public blog listing page (
/[malet]/blog). - Route:
ngwenya-deck/src/routes/[malet]/manage/blog/+page.svelte(Frontend) - Features:
- List of all blog posts for the Malet.
- Status-based filtering (All, Draft, Published, etc.) implemented client-side.
- Quick navigation to create new posts or edit existing ones.
Publishing Flow
- Creation:
ngwenya-deck/src/routes/[malet]/manage/blog/new/+page.svelte - Status Support: The
statusfield is correctly passed during creation.- Draft: Saves the post with
DRAFTstatus. - Publish: Saves the post with
PUBLISHEDstatus, making it immediately visible on the public Malet profile.
- Draft: Saves the post with
Technical Implementation
GraphQL Integration
- Mutation:
CREATE_BLOGincludes thestatusfield in its input. - DTO Validation: (Backend)
BlogInputDTOrequires@IsOptional()and@IsEnum(BlogStatus)decorators to pass theclass-validatorwhitelist middleware.
Frontend Logic
- Reactive Filtering: The management page uses a reactive
filteredBlogsvariable to handle status filtering without re-fetching from the server unnecessarily. - Loop Prevention: Fixed a common Svelte reactivity pitfall where updating a variable inside its own reactive statement caused infinite loops.
Navigation Routes
- Public List:
/[malet]/blog(Shows onlyPUBLISHEDposts by default). - Management:
deck.mallnline.com/[malet]/manage/blog - Editor:
deck.mallnline.com/[malet]/manage/blog/newordeck.mallnline.com/[malet]/manage/blog/[id]