Implement deleting of pastes

This commit is contained in:
Daan Sprenkels
2019-09-21 13:11:38 +02:00
parent 173ae7665b
commit 1c926a4864
4 changed files with 240 additions and 161 deletions

View File

@@ -1,5 +1,17 @@
key: {{.Paste.Key}}
type: {{.Paste.Type}}
state: {{.Paste.State}}
created: {{.Paste.TimeCreated}}
owner: {{if .IsOwner}}yes{{else}}no{{end}}
METADATA on <{{.Request.Host}}/{{.Paste.Key}}>:
TYPE: {{.Paste.Type}}
STATE: {{.Paste.State}}
{{if .Paste.TimeCreated.IsZero -}}
CREATED: undefined
{{else -}}
CREATED: {{.Paste.TimeCreated}}
{{end -}}
DELETE TOKEN: {{.CanDelete.String}}
{{if and (ne .Paste.State.String "deleted") .CanDelete.Bool}}
```
# To delete this {{.Paste.Type}}, execute:
curl --request "DELETE" "{{.Request.Host}}/{{.Paste.Key}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}"
```
{{end}}