portfolio/api/docs/openAPI/openApiGenericEndpoints.go
2024-07-04 12:32:48 +02:00

21 lines
555 B
Go

package main
import (
"github.com/a-h/respond"
"github.com/a-h/rest"
"net/http"
)
func RegisterGenericEndpoints() {
api.Get("/check").
HasDescription("check for user jwt cookie").
HasResponseModel(http.StatusOK, rest.ModelOf[string]()).
HasResponseModel(http.StatusInternalServerError, rest.ModelOf[respond.Error]()).
HasResponseModel(http.StatusUnprocessableEntity, rest.ModelOf[respond.Error]())
api.Get("/htmx/canEdit").
HasDescription("check if user is allowed to edit").
HasResponseModel(http.StatusOK, rest.ModelOf[string]())
}