oclib update + controller adjustment
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"oc-datacenter/infrastructure"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
oclib "cloud.o-forge.io/core/oc-lib"
|
||||
@@ -198,7 +199,6 @@ func (o *BookingController) Check() {
|
||||
// @Success 200 {object} models.object
|
||||
// @router / [post]
|
||||
func (o *BookingController) Post() {
|
||||
fmt.Println("POST")
|
||||
/*
|
||||
* This function is used to create a booking.
|
||||
* It takes the following parameters:
|
||||
@@ -239,7 +239,19 @@ func (o *BookingController) Post() {
|
||||
o.ServeJSON()
|
||||
return
|
||||
}
|
||||
fmt.Println("there was an error creating the namespace", o.createNamespace(resp.ExecutionsID))
|
||||
if err := o.createNamespace(resp.ExecutionsID); err != nil {
|
||||
if strings.Contains(err.Error(), "already exists") {
|
||||
err = nil
|
||||
} else {
|
||||
o.Data["json"] = map[string]interface{}{
|
||||
"data": nil,
|
||||
"code": 500,
|
||||
"error": err.Error(),
|
||||
}
|
||||
o.ServeJSON()
|
||||
return
|
||||
}
|
||||
}
|
||||
o.Data["json"] = map[string]interface{}{
|
||||
"data": []interface{}{b},
|
||||
"code": 200,
|
||||
|
||||
Reference in New Issue
Block a user