git commit
This commit is contained in:
parent
ff54f69127
commit
ce4646b060
@ -1,6 +1,7 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
oclib "cloud.o-forge.io/core/oc-lib"
|
||||
@ -65,23 +66,14 @@ func (o *WorkflowExecutionController) Get() {
|
||||
func (o *WorkflowExecutionController) Check() {
|
||||
// store and return Id or post with UUID
|
||||
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{}{
|
||||
"data": map[string]interface{}{
|
||||
"is_available": false,
|
||||
},
|
||||
"code": 400,
|
||||
"error": err,
|
||||
}
|
||||
} 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,
|
||||
"error": errors.New("invalid date format"),
|
||||
}
|
||||
} else {
|
||||
workflow := &w.Workflow{}
|
||||
@ -101,6 +93,5 @@ func (o *WorkflowExecutionController) Check() {
|
||||
"error": err,
|
||||
}
|
||||
}
|
||||
}
|
||||
o.ServeJSON()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user