mirror of
https://github.com/lus/pasty.git
synced 2023-08-10 21:13:09 +03:00
Update paste report webhook request
This commit is contained in:
parent
e8f7fa239e
commit
6172ad463b
8
API.md
8
API.md
@ -180,5 +180,11 @@ POST /api/v2/pastes/{paste_id}/report
|
||||
|
||||
**Notes:**
|
||||
* The endpoint is only available if the report system is enabled. Otherwise it will return a `404 Not Found` error.
|
||||
* The request for this endpoint is the exact same that will reach the webhook.
|
||||
* The request that will reach the report webhook looks like this:
|
||||
```json
|
||||
{
|
||||
"paste": "paste_id",
|
||||
"reason": "reason"
|
||||
}
|
||||
```
|
||||
* The response from this endpoint is the exact same that pasty expects from the webhook.
|
@ -12,7 +12,6 @@ import (
|
||||
type ReportRequest struct {
|
||||
Paste string `json:"paste"`
|
||||
Reason string `json:"reason"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
|
||||
// ReportResponse represents a report response received from the report webhook
|
||||
|
@ -257,7 +257,6 @@ func endpointReportPaste(ctx *fasthttp.RequestCtx) {
|
||||
request := &report.ReportRequest{
|
||||
Paste: ctx.UserValue("_paste").(*shared.Paste).ID,
|
||||
Reason: payload.Reason,
|
||||
Timestamp: time.Now().Unix(),
|
||||
}
|
||||
response, err := report.SendReport(request)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user