mirror of
https://github.com/lus/pasty.git
synced 2023-08-10 21:13:09 +03:00
Remove the paste-specific autoDelete field
This commit is contained in:
@@ -44,10 +44,9 @@ func HastebinSupportHandler(ctx *fasthttp.RequestCtx) {
|
||||
|
||||
// Create the paste object
|
||||
paste := &shared.Paste{
|
||||
ID: id,
|
||||
Content: content,
|
||||
Created: time.Now().Unix(),
|
||||
AutoDelete: config.Current.AutoDelete.Enabled,
|
||||
ID: id,
|
||||
Content: content,
|
||||
Created: time.Now().Unix(),
|
||||
}
|
||||
|
||||
// Set a modification token
|
||||
|
@@ -7,7 +7,6 @@ type legacyPaste struct {
|
||||
Content string `json:"content"`
|
||||
DeletionToken string `json:"deletionToken,omitempty"`
|
||||
Created int64 `json:"created"`
|
||||
AutoDelete bool `json:"autoDelete"`
|
||||
}
|
||||
|
||||
func legacyFromModern(paste *shared.Paste) *legacyPaste {
|
||||
@@ -21,6 +20,5 @@ func legacyFromModern(paste *shared.Paste) *legacyPaste {
|
||||
Content: paste.Content,
|
||||
DeletionToken: deletionToken,
|
||||
Created: paste.Created,
|
||||
AutoDelete: paste.AutoDelete,
|
||||
}
|
||||
}
|
||||
|
@@ -86,10 +86,9 @@ func v1PostPaste(ctx *fasthttp.RequestCtx) {
|
||||
|
||||
// Create the paste object
|
||||
paste := &shared.Paste{
|
||||
ID: id,
|
||||
Content: values["content"],
|
||||
Created: time.Now().Unix(),
|
||||
AutoDelete: config.Current.AutoDelete.Enabled,
|
||||
ID: id,
|
||||
Content: values["content"],
|
||||
Created: time.Now().Unix(),
|
||||
}
|
||||
|
||||
// Set a modification token
|
||||
|
@@ -136,11 +136,10 @@ func endpointCreatePaste(ctx *fasthttp.RequestCtx) {
|
||||
payload.Metadata = map[string]interface{}{}
|
||||
}
|
||||
paste := &shared.Paste{
|
||||
ID: id,
|
||||
Content: payload.Content,
|
||||
Created: time.Now().Unix(),
|
||||
AutoDelete: config.Current.AutoDelete.Enabled,
|
||||
Metadata: payload.Metadata,
|
||||
ID: id,
|
||||
Content: payload.Content,
|
||||
Created: time.Now().Unix(),
|
||||
Metadata: payload.Metadata,
|
||||
}
|
||||
|
||||
// Create a new modification token if enabled
|
||||
|
Reference in New Issue
Block a user