Skip to content

Commit

Permalink
Merging the develop branch into the main branch (v3.1.2)
Browse files Browse the repository at this point in the history
Changing code= to gift-code= in redemption URL (#73)
  • Loading branch information
EvgenKor authored Apr 25, 2023
2 parents 0d5866e + ad5dd9f commit 77f36dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zkbob-console",
"version": "3.1.1",
"version": "3.1.2",
"license": "MIT",
"author": "Dmitry Vdovin <[email protected]>",
"homepage": "https://github.com/zkBob/zkbob-console",
Expand Down
6 changes: 3 additions & 3 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ export async function generateGiftCards(prefix: string, quantity: string, cardBa

async function redemptionUrl(giftCard: GiftCardProperties, baseUrl: string, account: Account): Promise<string> {
const code = await account.codeForGiftCard(giftCard);
return `${baseUrl}/?code=${code}`;
return `${baseUrl}/?gift-code=${code}`;
}

async function extractGiftCard(codeOrUrl: string, account: Account): Promise<GiftCardProperties> {
Expand All @@ -1033,8 +1033,8 @@ async function extractGiftCard(codeOrUrl: string, account: Account): Promise<Gif

const url = new URL(codeOrUrl);
const urlSearchParams = new URLSearchParams(url.search.slice(1));
if (urlSearchParams.has('code')) {
return await account.giftCardFromCode(urlSearchParams.get('code'));
if (urlSearchParams.has('gift-code')) {
return await account.giftCardFromCode(urlSearchParams.get('gift-code'));
}

throw new Error('Cannot extract correct gift card from provided code or redemption URL');
Expand Down

0 comments on commit 77f36dc

Please sign in to comment.