Skip to content

Commit

Permalink
rebasing from last merge
Browse files Browse the repository at this point in the history
  • Loading branch information
salviosage committed Aug 27, 2019
1 parent 819fc16 commit 76f397f
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/helpers/pagination.helper.js

This file was deleted.

159 changes: 159 additions & 0 deletions src/routes/api/reports/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@

/reports/{articleSlug}:
post:
summary: report an article
description: >
report article which is not yours
tags:
- Report
produces:
- application/json
parameters:
- name: x-access-token
in: header
schema:
type: string
required:
- authorization
- name: reason
in: body
description: reason for reporting article
responses:
200:
description: OK
schema:
$ref: '#definitions/Report'
400:
$ref: '#responses/BadRequest'
get:
summary: get reports for a certain article
description: >
admin can get report made for a specific article
tags:
- Report
produces:
- application/json
parameters:
- name: x-access-token
in: header
schema:
type: string
required:
- authorization
responses:
200:
description: Reports for an article retrieved successfully
schema:
$ref: '#definitions/Report'
400:
$ref: '#responses/BadRequest'
/reports/all:
get:
summary: get all reports
description: >
admin can get all reports including pagination for it
tags:
- Report
produces:
- application/json
parameters:
- name: x-access-token
in: header
schema:
type: string
required:
- authorization
responses:
200:
description: Reports retrieved successfully
schema:
$ref: '#definitions/Report'
400:
$ref: '#responses/BadRequest'
/reports:
get:
summary: get your reports
description: >
get all the reports you have made
tags:
- Report
produces:
- application/json
parameters:
- name: x-access-token
in: header
schema:
type: string
required:
- authorization
responses:
200:
description: Your reports retrieved successfully
schema:
$ref: '#definitions/Report'
400:
$ref: '#responses/BadRequest'
/reports/{reportid}:
delete:
summary: delete your report
description: >
user can delete his/her report or admin can
tags:
- Report
produces:
- application/json
parameters:
- name: x-access-token
in: header
schema:
type: string
required:
- authorization
responses:
200:
description: Report successfully deleted
schema:
$ref: '#definitions/Report'
400:
$ref: '#responses/BadRequest'
tags:
- name: Report
description: Operations related to Report
responses:
success:
description: Success
schema:
$ref: '#/definitions/Report'
BadRequest:
description: Bad request
schema:
$ref: '#/definitions/Error'
Notfound:
description: Not found
schema:
$ref: '#/definitions/Error'
definitions:
Report:
type: object
properties:
status:
type: string
description: username
message:
type: string
description: description of data retrieved
data:
type: object
description: data retrieved
required:
- body
- image
Error:
type: object
properties:
status:
type: string
description: status code
message:
type: string
description: description of error

0 comments on commit 76f397f

Please sign in to comment.