1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Specify relinquish parameters

This commit is contained in:
Zack Scholl 2017-06-28 10:10:32 -06:00
parent b7fc420f7e
commit 228b324149

View File

@ -78,11 +78,14 @@ func handlePageRelinquish(c *gin.Context) {
message := "Relinquished" message := "Relinquished"
p := Open(json.Page) p := Open(json.Page)
text := p.Text.GetCurrent() text := p.Text.GetCurrent()
isLocked := p.IsEncrypted
isEncrypted := p.IsEncrypted
destroyed := p.IsPrimedForSelfDestruct
if !p.IsLocked && p.IsPrimedForSelfDestruct { if !p.IsLocked && p.IsPrimedForSelfDestruct {
p.Erase() p.Erase()
message = "Relinquished and erased" message = "Relinquished and erased"
} }
c.JSON(http.StatusOK, gin.H{"success": true, "message": message, "text": text}) c.JSON(http.StatusOK, gin.H{"success": true, "message": message, "text": text, "locked": isLocked, "encrypted": isEncrypted, "destroyed": destroyed})
} }
func handlePageRequest(c *gin.Context) { func handlePageRequest(c *gin.Context) {