implement remote call for remote action
This commit is contained in:
parent
2ac24779cd
commit
bc8c508e04
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user