ktor-arrow-example icon indicating copy to clipboard operation
ktor-arrow-example copied to clipboard

POST /articles/{slug}/comments

Open nomisRev opened this issue 2 years ago • 4 comments
trafficstars

In order to fully support articles we need to implement a POST article comments for slug, according to following OpenAPI Spec.

    post:
      tags:
        - Comments
      summary: Create a comment for an article
      description: Create a comment for an article. Auth is required
      operationId: CreateArticleComment
      parameters:
        - name: slug
          in: path
          description: Slug of the article that you want to create a comment for
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/NewCommentRequest'
      responses:
        '200':
          $ref: '#/components/responses/SingleCommentResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/GenericError'
      security:
        - Token: []
      x-codegen-request-body-name: comment
  1. Add missing domain objects NewCommentRequest and SingleCommentResponse if it doesn't exist.
  2. Implement insertCommentForArticleSlug in ArticlePersistence by adding the corresponding SQL to SqlDelight
  3. Create articles.kt in routes if does not exist, implement the POST route using ArticlePersistence
  4. Add test that verifies the behavior works

Please assign yourself to this ticket before starting, and if you run into any issues please raise a PR so I can provide help and support directly in the code.

Thank you in advance for your interest in the project! Happy hacktoberfest!

nomisRev avatar Sep 25 '23 12:09 nomisRev

Hey @nomisRev I'd like to work on this task.

Kaaveh avatar Oct 29 '23 15:10 Kaaveh

Hey @Kaaveh, Please do! Sorry for the late response, I needed some off time.

nomisRev avatar Nov 23 '23 10:11 nomisRev

Hey @nomisRev Thank you for assigning me to this task. Unfortunately, I am currently facing some issues that prevent me from working on side projects. I estimate that I will be able to work on this feature in the next couple of months. Is that okay?

Kaaveh avatar Dec 15 '23 18:12 Kaaveh

Hmmm, It seems that the task has been completed. @nomisRev @arioston

Kaaveh avatar Jan 20 '24 20:01 Kaaveh