change interface{} to any, move apiError function to bottom

This commit is contained in:
Danila Fominykh 2023-10-02 23:47:32 -03:00
parent 33ae3bd5ce
commit 94f45f402f
No known key found for this signature in database
GPG Key ID: 1134F8EBF98AA06F

View File

@ -18,6 +18,12 @@ import (
arch_service "code.gitea.io/gitea/services/packages/arch"
)
func apiError(ctx *context.Context, status int, obj any) {
helper.LogAndProcessError(ctx, status, obj, func(message string) {
ctx.PlainText(status, message)
})
}
// Push new package to arch package registry.
func Push(ctx *context.Context) {
var (
@ -185,9 +191,3 @@ func Remove(ctx *context.Context) {
ctx.Status(http.StatusOK)
}
func apiError(ctx *context.Context, status int, obj interface{}) {
helper.LogAndProcessError(ctx, status, obj, func(message string) {
ctx.PlainText(status, message)
})
}