updates
This commit is contained in:
@@ -42,6 +42,11 @@ func StoreSecret(c *gin.Context) {
|
||||
s.RoleId = 1
|
||||
}
|
||||
|
||||
if input.DeviceCategory == "" && input.DeviceName == "" {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "cannot store secret with empty deviceName and empty deviceCategory"})
|
||||
return
|
||||
}
|
||||
|
||||
// If this secret already exists in the database then generate an error
|
||||
checkExists, err := models.GetSecrets(&s)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user