Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default to null instead of zero for nullable andpoints #207

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Blockcore.Indexer.Core/Controllers/QueryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public IActionResult GetAddressesBalance(IList<string> addresses, bool? includeU
/// <returns></returns>
[HttpGet]
[Route("address/{address}/transactions")]
public IActionResult GetAddressTransactions([MinLength(4)][MaxLength(100)] string address, [Range(0, int.MaxValue)] int? offset = 0, [Range(1, 50)] int limit = 10)
public IActionResult GetAddressTransactions([MinLength(4)][MaxLength(100)] string address, [Range(0, int.MaxValue)] int? offset = null, [Range(1, 50)] int limit = 10)
{
return OkPaging(storage.AddressHistory(address, offset, limit));
}
Expand Down Expand Up @@ -140,7 +140,7 @@ public IActionResult GetTransactionHex(string transactionId)
/// <param name="limit">Number of blocks to return. Maximum 50.</param>
[HttpGet]
[Route("block")]
public IActionResult GetBlocks([Range(0, int.MaxValue)] int? offset = 0, [Range(1, 50)] int limit = 10)
public IActionResult GetBlocks([Range(0, int.MaxValue)] int? offset = null, [Range(1, 50)] int limit = 10)
{
return OkPaging(storage.Blocks(offset, limit));
}
Expand Down Expand Up @@ -189,7 +189,7 @@ public IActionResult GetBlockHex(string hash)
/// <param name="limit">Number of blocks to return. Maximum 50.</param>
[HttpGet]
[Route("block/orphan")]
public IActionResult GetOrphanBlocks([Range(0, int.MaxValue)] int? offset = 0, [Range(1, 50)] int limit = 10)
public IActionResult GetOrphanBlocks([Range(0, int.MaxValue)] int? offset = null, [Range(1, 50)] int limit = 10)
{
return OkPaging(storage.OrphanBlocks(offset, limit));
}
Expand Down
Loading