try to improve ListSecrets
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -336,7 +336,7 @@ func UpdateSecret(c *gin.Context) {
|
||||
func DeleteSecret(c *gin.Context) {
|
||||
var err error
|
||||
var input SecretInput
|
||||
var user_id int
|
||||
var UserId int
|
||||
|
||||
if err := c.ShouldBindJSON(&input); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "DeleteSecret error binding to input JSON : " + err.Error()})
|
||||
@@ -350,7 +350,7 @@ func DeleteSecret(c *gin.Context) {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "error determining user"})
|
||||
return
|
||||
} else {
|
||||
user_id = val.(int)
|
||||
UserId = val.(int)
|
||||
//log.Printf("user_id: %v\n", user_id)
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ func DeleteSecret(c *gin.Context) {
|
||||
s.DeviceName = input.DeviceName
|
||||
s.DeviceCategory = input.DeviceCategory
|
||||
|
||||
secretList, err := models.SecretsGetAllowed(&s, user_id)
|
||||
secretList, err := models.SecretsGetAllowed(&s, UserId)
|
||||
if err != nil {
|
||||
errString := fmt.Sprintf("error getting allowed secrets : '%s'", err)
|
||||
log.Printf("DeleteSecret %s\n", errString)
|
||||
|
Reference in New Issue
Block a user