add search by username
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:
@@ -92,6 +92,20 @@ func RetrieveSecretByDevicecategory(c *gin.Context) {
|
||||
retrieveSpecifiedSecret(&s, c)
|
||||
}
|
||||
|
||||
func RetrieveSecretByUsername(c *gin.Context) {
|
||||
userName := c.Param("username")
|
||||
|
||||
if userName == "" {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "no username value specified"})
|
||||
return
|
||||
}
|
||||
|
||||
// Create object based on specified data
|
||||
s := models.Secret{UserName: userName}
|
||||
|
||||
retrieveSpecifiedSecret(&s, c)
|
||||
}
|
||||
|
||||
func retrieveSpecifiedSecret(s *models.Secret, c *gin.Context) {
|
||||
/*
|
||||
// Get the user and role id of the requestor
|
||||
|
Reference in New Issue
Block a user