brick.ts
All examples

Comments plugin

A comments plugin built with definePlugin: it owns its table, checks typed options, hooks into the host resource's CRUD writes and ships a dashboard extension.

  • Plugins
  • CRUD
  • SQLite

1 services, 16 actions, 2 tables, 9 files

Open in GitHub

Features

  • definePlugin with owned tables and typed options
  • Host CRUD hooks: deleting a page deletes its comments
  • Catalog event comments.added and a dashboard extension

Service graph

TablesServiceResources and actionspages1 colspage_comments4 colspage8 actionspageComment8 actionspagessqlite

Actions and routes

pages

MethodPathActionAccess
POST/api/pages/page/querypage.listpublic
GET/api/pages/page/:idpage.getpublic
POST/api/pages/pagepage.createpublic
PATCH/api/pages/page/:idpage.updatepublic
DELETE/api/pages/page/:idpage.deletepublic
POST/api/pages/page/find-onepage.findOnepublic
POST/api/pages/page/countpage.countpublic
POST/api/pages/page/existspage.existspublic
POST/api/pages/page-comment/querypageComment.listpublic
GET/api/pages/page-comment/:idpageComment.getpublic
POST/api/pages/page-commentpageComment.createpublic
PATCH/api/pages/page-comment/:idpageComment.updatepublic
DELETE/api/pages/page-comment/:idpageComment.deletepublic
POST/api/pages/page-comment/find-onepageComment.findOnepublic
POST/api/pages/page-comment/countpageComment.countpublic
POST/api/pages/page-comment/existspageComment.existspublic

Database tables

pages
idtextPK
page_comments
idtextPK
target_idtextNOT NULL
bodytextNOT NULL
created_atintegerNOT NULL

Source

Loading source…

Run it

The server listens on port 3001.