Remove until validation in restapi when creating an availability

This commit is contained in:
Arnaud 2025-02-21 17:09:34 +01:00
parent 2b02d38b45
commit dba109fda1
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663

View File

@ -463,14 +463,6 @@ proc initSalesApi(node: CodexNodeRef, router: var RestRouter) =
Http400, "Total size must be larger then zero", headers = headers
)
let until = restAv.until |? 0
if until < 0:
return RestApiResponse.error(
Http400,
"Until parameter must be greater or equal 0. Got: " & $until,
headers = headers,
)
if not reservations.hasAvailable(restAv.totalSize.truncate(uint)):
return
RestApiResponse.error(Http422, "Not enough storage quota", headers = headers)
@ -482,7 +474,7 @@ proc initSalesApi(node: CodexNodeRef, router: var RestRouter) =
restAv.minPricePerBytePerSecond,
restAv.totalCollateral,
enabled = restAv.enabled |? true,
until = until,
until = restAv.until |? 0,
)
), error:
return RestApiResponse.error(Http500, error.msg, headers = headers)