mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-09-27 13:29:04 +02:00
format api routes
This commit is contained in:
@@ -22,6 +22,7 @@ type versionOutput struct {
|
||||
// NewVersionController registers version-related routes
|
||||
func NewVersionController(api huma.API, authMiddleware *middleware.AuthMiddleware, versionService *service.VersionService) {
|
||||
vc := &VersionController{versionService: versionService}
|
||||
userAuth := authMiddleware.WithAdminNotRequired().Huma(api)
|
||||
|
||||
httpapi.Register(api, huma.Operation{
|
||||
OperationID: "get-latest-version",
|
||||
@@ -31,15 +32,13 @@ func NewVersionController(api huma.API, authMiddleware *middleware.AuthMiddlewar
|
||||
Tags: []string{"Version"},
|
||||
}, vc.getLatestVersionHandler)
|
||||
|
||||
currentOperation := huma.Operation{
|
||||
httpapi.Register(api, huma.Operation{
|
||||
OperationID: "get-current-version",
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/version/current",
|
||||
Summary: "Get current deployed version of Pocket ID",
|
||||
Tags: []string{"Version"},
|
||||
}
|
||||
authMiddleware.WithAdminNotRequired().Huma(api)(¤tOperation)
|
||||
httpapi.Register(api, currentOperation, vc.getCurrentVersionHandler)
|
||||
}, vc.getCurrentVersionHandler, userAuth)
|
||||
}
|
||||
|
||||
type VersionController struct {
|
||||
|
||||
Reference in New Issue
Block a user