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

POST /articles/{slug}/favorite

Open nomisRev opened this issue 2 years ago • 1 comments

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

  /articles/{slug}/favorite:
    post:
      tags:
        - Favorites
      summary: Favorite an article
      description: Favorite an article. Auth is required
      operationId: CreateArticleFavorite
      parameters:
        - name: slug
          in: path
          description: Slug of the article that you want to favorite
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/SingleArticleResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/GenericError'
      security:
        - Token: []
  1. Add missing domain objects SingleArticleResponse if it doesn't exist.
  2. Implement unfavoriteArticleWithSlug 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

I'd like to work on this @nomisRev :)

javimartinez avatar Oct 24 '23 08:10 javimartinez