From d110fba3ff9bf44ccb7f857eb61d910237e6f3f8 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Wed, 22 Mar 2023 13:06:31 +0700 Subject: [PATCH] Return data as camelCase --- config/game-config.json | 3 +++ src/pages/api/user/[userId]/staking-sources.ts | 4 ++-- test-endpoints.restclient | 2 +- typings.d.ts | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config/game-config.json b/config/game-config.json index 6e98fd8..172b293 100644 --- a/config/game-config.json +++ b/config/game-config.json @@ -6,6 +6,9 @@ "resourceMinStartAmount": 50, "resourceMaxStartAmount": 200 }, + "items": { + "maxItemUpgrade": 5 + }, "store": [ { "id": "item1", diff --git a/src/pages/api/user/[userId]/staking-sources.ts b/src/pages/api/user/[userId]/staking-sources.ts index 99b03c7..a55e568 100644 --- a/src/pages/api/user/[userId]/staking-sources.ts +++ b/src/pages/api/user/[userId]/staking-sources.ts @@ -27,8 +27,8 @@ export default async function handler( source.resourceWells = resourceWells; const stakesSql = ` SELECT staking_event.id, resname as resourceType, source_id as stakingSourceId, - inventory_item_id, duration_in_mins, stake_amount, - staking_event.created_at as startTime + inventory_item_id as inventoryItemId, duration_in_mins as durationInMins, + stake_amount as stakeAmount, staking_event.created_at as startTime FROM staking_event INNER JOIN resource_well ON well_id = resource_well.id INNER JOIN staking_source ON source_id = staking_source.id diff --git a/test-endpoints.restclient b/test-endpoints.restclient index dc7a390..a34665d 100644 --- a/test-endpoints.restclient +++ b/test-endpoints.restclient @@ -44,7 +44,7 @@ GET http://localhost:3000/api/user/1/stakes/ # Start a stake POST http://localhost:3000/api/user/1/stakes/start :headers -{ "inventoryItemId": "item1", "wellId": 7 } +{ "inventoryItemId": 1, "wellId": 1 } # Claim a stake POST http://localhost:3000/api/user/1/stakes/claim diff --git a/typings.d.ts b/typings.d.ts index 060c79b..7a7fd7c 100644 --- a/typings.d.ts +++ b/typings.d.ts @@ -23,7 +23,7 @@ export interface IStake { inventoryItemId: number; stakeAmount: number; durationInMins: number; - unclaimed: boolean; + unclaimed: boolean | undefined; claimable: boolean | undefined remainingTime: number | undefined }