This commit is contained in:
Waris Aiemworawutikul
2024-07-23 18:30:07 +07:00
parent 43a85c5171
commit df59e5fb46
2 changed files with 6 additions and 5 deletions

View File

@@ -16,8 +16,9 @@ type DelegateValidator struct {
}
func New() *DelegateValidator {
v := validator.New()
return &DelegateValidator{
Validator: validator.Validator{Valid: true},
Validator: *v,
}
}

View File

@@ -28,8 +28,9 @@ type PurchaseValidator struct {
}
func New() *PurchaseValidator {
v := validator.New()
return &PurchaseValidator{
Validator: validator.Validator{Valid: true},
Validator: *v,
}
}
@@ -49,10 +50,9 @@ func (v *PurchaseValidator) NodeSaleExists(ctx context.Context, qtx datagateway.
if len(deploys) < 1 {
v.Valid = false
return v.Valid, nil, nil
} else {
v.Valid = true
return v.Valid, &deploys[0], nil
}
v.Valid = true
return v.Valid, &deploys[0], nil
}
func (v *PurchaseValidator) ValidTimestamp(deploy *entity.NodeSale, timestamp time.Time) bool {