admin only route is working
This commit is contained in:
20
controllers/retrieve_secrets.go
Normal file
20
controllers/retrieve_secrets.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type RetrieveInput struct {
|
||||
DeviceName string `json:"deviceName" binding:"required"`
|
||||
}
|
||||
|
||||
func Retrieve(c *gin.Context) {
|
||||
var input RetrieveInput
|
||||
|
||||
if err := c.ShouldBindJSON(&input); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user