fix(api): fix compilation errors in license key handlers #254
@@ -10,6 +10,7 @@ import (
|
||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/models/licenses"
|
||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/structs"
|
||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/timeutil"
|
||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/web"
|
||||
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/services/context"
|
||||
)
|
||||
|
||||
@@ -71,11 +72,7 @@ func ListLicensePackages(ctx *context.APIContext) {
|
||||
|
||||
// CreateLicensePackage creates a new license package.
|
||||
func CreateLicensePackage(ctx *context.APIContext) {
|
||||
form := &structs.CreateLicensePackageOption{}
|
||||
if err := ctx.Bind(form); err != nil {
|
||||
ctx.APIErrorValidation(err)
|
||||
return
|
||||
}
|
||||
form := web.GetForm(ctx).(*structs.CreateLicensePackageOption)
|
||||
|
||||
pkg := &licenses.LicensePackage{
|
||||
OwnerID: ctx.Repo.Repository.OwnerID,
|
||||
@@ -115,11 +112,7 @@ func ListLicenseKeys(ctx *context.APIContext) {
|
||||
|
||||
// CreateLicenseKey creates a new license key.
|
||||
func CreateLicenseKey(ctx *context.APIContext) {
|
||||
form := &structs.CreateLicenseKeyOption{}
|
||||
if err := ctx.Bind(form); err != nil {
|
||||
ctx.APIErrorValidation(err)
|
||||
return
|
||||
}
|
||||
form := web.GetForm(ctx).(*structs.CreateLicenseKeyOption)
|
||||
|
||||
key := &licenses.LicenseKey{
|
||||
PackageID: form.PackageID,
|
||||
|
||||
Reference in New Issue
Block a user