diff --git a/internal/pastes/paste.go b/internal/pastes/paste.go index 9f83034..4b3a08a 100644 --- a/internal/pastes/paste.go +++ b/internal/pastes/paste.go @@ -11,7 +11,7 @@ type Paste struct { ID string `json:"id" bson:"_id"` Content string `json:"content" bson:"content"` SuggestedSyntaxType string `json:"suggestedSyntaxType" bson:"suggestedSyntaxType"` - DeletionToken string `json:"deletionToken" bson:"deletionToken"` + DeletionToken string `json:"deletionToken" bson:"deletionToken,omitempty"` Created int64 `json:"created" bson:"created"` AutoDelete bool `json:"autoDelete" bson:"autoDelete"` } diff --git a/internal/web/controllers/v1/pastes.go b/internal/web/controllers/v1/pastes.go index f8f7171..ed25f10 100644 --- a/internal/web/controllers/v1/pastes.go +++ b/internal/web/controllers/v1/pastes.go @@ -33,6 +33,7 @@ func v1GetPaste(ctx *fasthttp.RequestCtx) { ctx.SetBodyString("paste not found") return } + paste.DeletionToken = "" // Respond with the paste jsonData, err := json.Marshal(paste)