neo oc-lib
This commit is contained in:
@@ -56,6 +56,7 @@ func (o *WorkflowController) Put() {
|
||||
var res map[string]interface{}
|
||||
id := o.Ctx.Input.Param(":id")
|
||||
json.Unmarshal(o.Ctx.Input.CopyBody(10000000), &res)
|
||||
fmt.Println("res", res["links"])
|
||||
caller := tools.NewHTTPCaller(paths) // create a new HTTP caller
|
||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||
o.Ctx.Input.Param("is_remote")
|
||||
@@ -161,7 +162,7 @@ func (o *WorkflowController) Check() {
|
||||
} else {
|
||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
res := oclib.NewRequest(oclib.LibDataEnum(oclib.WORKFLOW), user, peerID, groups, nil).LoadOne(id)
|
||||
if res.Code == 200 {
|
||||
if res.Data != nil {
|
||||
workflow := res.ToWorkflow()
|
||||
caller := tools.NewHTTPCaller(map[tools.DataType]map[tools.METHOD]string{ // paths to call other OC services
|
||||
tools.PEER: {
|
||||
@@ -172,7 +173,7 @@ func (o *WorkflowController) Check() {
|
||||
},
|
||||
})
|
||||
isAvailable, err := workflow.CheckBooking(caller) // check booking
|
||||
fmt.Println("isAvailable", isAvailable, o.Ctx.Input.Param(":start_date"), o.Ctx.Input.Param(":end_date"))
|
||||
fmt.Println("isAvailable", isAvailable, o.Ctx.Input.Param(":start_date"), o.Ctx.Input.Param(":end_date"), err)
|
||||
code := 200
|
||||
if !isAvailable { // if not available then its a conflict
|
||||
code = 409
|
||||
@@ -187,7 +188,6 @@ func (o *WorkflowController) Check() {
|
||||
} else {
|
||||
o.Data["json"] = res
|
||||
}
|
||||
|
||||
}
|
||||
o.ServeJSON()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user