Handle null when item hasn't been upgraded

This commit is contained in:
Joseph Ferano 2023-04-29 15:20:43 +07:00
parent 6c1ac1838f
commit b965371fe5
2 changed files with 9 additions and 8 deletions

View File

@ -396,7 +396,7 @@ begin
raise exception 'Unable to find an inventory item that is owned and not actively staked';
end if;
select claim_amount + claim_boost
select claim_amount + coalesce(claim_boost, 0)
into total_stake_amount
from inventory_item
join store_item on inventory_item.store_item_id = store_item.id

View File

@ -2,6 +2,7 @@
Content-Type: application/json
#
:user_id = 595ab570-fa74-4c6c-980e-4c80d1064dd1
:host = https://moonminers.app/api
# Seed the SQLite database (deprecated)
GET http://localhost:3000/api/seed
@ -11,8 +12,12 @@ GET http://localhost:3000/api/seed
POST http://localhost:3000/api/import-config
:headers
# Get leaderboards
GET :host/leaderboards
:headers
# Get Inventory Items
POST http://localhost:3000/api/user/login
POST :host/user/login
:headers
{ "wallet" : "Wallet12345678" }
@ -40,10 +45,6 @@ PUT http://localhost:3000/api/user/:user_id/account
POST http://localhost:3000/api/user/:user_id/clear-data
:headers
# Get leaderboards
GET http://localhost:3000/api/leaderboards
:headers
# Get game config
GET http://localhost:3000/api/get-game-config
:headers
@ -77,8 +78,8 @@ GET http://localhost:3000/api/user/:user_id/stakes/
# Start a stake
POST http://localhost:3000/api/user/:user_id/stakes/start
:headers
{ "inventoryItemId": "2bd5f846-ce1d-45be-998e-26d2e97b7f68"
, "wellId": "588ad177-83ca-4a5f-9672-bf97783ea42f" }
{ "inventoryItemId": "1db181dd-320f-4525-a00d-933e5d72d690"
, "wellId": "0a7fd54d-02cf-4c08-b106-6f812ad4b1ca" }
# Claim a stake
POST http://localhost:3000/api/user/:user_id/stakes/claim