forked from electricdusk/rushlink
Implement deleting of pastes
This commit is contained in:
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user