Skip to content
  • Kevin Morris's avatar
    feat(FastAPI): add pkgbase comments (new, edit) · fc28aad2
    Kevin Morris authored
    
    
    In PHP, this was implemented using an /rpc type 'get-comment-form'.
    With FastAPI, we've decided to reorganize this into a non-RPC route:
    `/pkgbase/{name}/comments/{id}/form`, rendered via the new
    `templates/partials/packages/comment_form.html` template.
    
    When the comment_form.html template is provided a `comment` object,
    it will produce an edit comment form. Otherwise, it will produce a new
    comment form.
    
    A few new FastAPI routes have been introduced:
    
    - GET `/pkgbase/{name}/comments/{id}/form`
        - Produces a JSON response based on {"form": "<form_markup>"}.
    - POST `/pkgbase/{name}/comments'
        - Creates a new comment.
    - POST `/pkgbase/{name}/comments/{id}`
        - Edits an existing comment.
    
    In addition, some Javascript has been modified for our new routes.
    
    Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
    fc28aad2