Skip to content

SERVER: Dashboard - Student view - Edit or Delete post #27

@Kerem-1034003

Description

@Kerem-1034003

Problem Description

As a user that is logged in , I want to edit and delete my posts,
so that I can update mistakes or remove content.

Required Changes

  • implement endpoint put/patch for editing /posts/{id}
  • implement endpoint delete for deleting /posts/{id}
    the endpoints should:
  • verify logged in user as author of post
  • update content and timestamp(edit)
  • remove post from database(delete)
  • return proper succes or error message

Acceptance Criteria

succes response

  • 200 updated post object (Edit)
  • 200 with message "post deleted"(Delete)
    error response
  • 403 if the user is not the author "you can't edit this post"
  • 403 if the user is not the author "you can't delete this post"
  • 404 if post doesn't exist (Edit+Delete)

Dependencies

  • required database table posts with user information
  • verify logged in user

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions