git commit
This commit is contained in:
parent
ff54f69127
commit
ce4646b060
@ -1,6 +1,7 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
oclib "cloud.o-forge.io/core/oc-lib"
|
oclib "cloud.o-forge.io/core/oc-lib"
|
||||||
@ -65,23 +66,14 @@ func (o *WorkflowExecutionController) Get() {
|
|||||||
func (o *WorkflowExecutionController) Check() {
|
func (o *WorkflowExecutionController) Check() {
|
||||||
// store and return Id or post with UUID
|
// store and return Id or post with UUID
|
||||||
date, err := time.Parse("2006-01-02T15:04:05", o.Ctx.Input.Param(":start_date"))
|
date, err := time.Parse("2006-01-02T15:04:05", o.Ctx.Input.Param(":start_date"))
|
||||||
if err != nil {
|
date2, err2 := time.Parse("2006-01-02T15:04:05", o.Ctx.Input.Param(":end_date"))
|
||||||
|
if err != nil || err2 != nil {
|
||||||
o.Data["json"] = map[string]interface{}{
|
o.Data["json"] = map[string]interface{}{
|
||||||
"data": map[string]interface{}{
|
"data": map[string]interface{}{
|
||||||
"is_available": false,
|
"is_available": false,
|
||||||
},
|
},
|
||||||
"code": 400,
|
"code": 400,
|
||||||
"error": err,
|
"error": errors.New("invalid date format"),
|
||||||
}
|
|
||||||
} else {
|
|
||||||
date2, err := time.Parse("2006-01-02T15:04:05", o.Ctx.Input.Param(":end_date"))
|
|
||||||
if err != nil {
|
|
||||||
o.Data["json"] = map[string]interface{}{
|
|
||||||
"data": map[string]interface{}{
|
|
||||||
"is_available": false,
|
|
||||||
},
|
|
||||||
"code": 400,
|
|
||||||
"error": err,
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
workflow := &w.Workflow{}
|
workflow := &w.Workflow{}
|
||||||
@ -101,6 +93,5 @@ func (o *WorkflowExecutionController) Check() {
|
|||||||
"error": err,
|
"error": err,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user