diff --git a/models/workflow/workflow.go b/models/workflow/workflow.go index 4a72ed5..6b06d78 100644 --- a/models/workflow/workflow.go +++ b/models/workflow/workflow.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "slices" + "strings" "time" "cloud.o-forge.io/core/oc-lib/models/resources" @@ -36,7 +37,7 @@ type Workflow struct { AbstractWorkflow } -func (wfa *Workflow) CheckBooking(caller *tools.HTTPCaller) (bool, error) { +func (wfa *Workflow) CheckBooking(subPath string) (bool, error) { // check if if wfa.Schedule == nil || wfa.Schedule.Start == nil || wfa.Graph == nil { return false, nil @@ -55,7 +56,10 @@ func (wfa *Workflow) CheckBooking(caller *tools.HTTPCaller) (bool, error) { } // CHECK BOOKING url := dc.(*datacenter.DatacenterResource).SourceUrl - resp, err := caller.CallGet(url, caller.OriginSubPath+"/"+wfa.getFormat(wfa.Schedule.Start)+"/"+wfa.getFormat(&e)) + caller := tools.NewHTTPCaller("", "", "", "") + subPath = strings.ReplaceAll(subPath, ":start_date", wfa.getFormat(wfa.Schedule.Start)) + subPath = strings.ReplaceAll(subPath, ":end_date", wfa.getFormat(&e)) + resp, err := caller.CallGet(url, subPath) if err != nil { return false, err }