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

Fix variables incorrect in Flow NFT Marketplace QueryForm.js #271

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions docs/tutorial/flow-nft-marketplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -1354,12 +1354,12 @@ This form should make a good use of the minting form. Once we're done, it will l

I know Mary is obviously *not* a Bulldog, but you will get a chance to add your breed options later.

Let's start by creating `QueryToken.jsx` file inside the `/components` directory.
Let's start by creating `QueryForm.js` file inside the `/components` directory.

```js
import { useState, useEffect } from 'react';

// QueryForm.jsx
// QueryForm.js

const style = {
padding: '1rem',
Expand All @@ -1377,7 +1377,7 @@ const QueryForm = () => {
useEffect(() => {
let getTokens = async () => {
// Set mock IDs for now
setTokenIds([1, 2, 3]);
setAllTokenIds([1, 2, 3]);
};
getTokens();
}, []);
Expand All @@ -1397,7 +1397,7 @@ const QueryForm = () => {
className="u-full-width"
type="number"
id="idInput"
onChange={(event) => setId(parseInt(event.target.value))}
onChange={(event) => setSelectedId(parseInt(event.target.value))}
>
{
// We want to display token IDs that are available.
Expand Down Expand Up @@ -1531,7 +1531,7 @@ const QueryForm = () => {
// Instead of dummy token IDs, we call `getAllTokenIds`
// to get real IDs of all existing tokens.
const ids = await getAllTokenIds();
setTokenIds(ids);
setAllTokenIds(ids);
};
getTokens();
}, []);
Expand Down Expand Up @@ -1563,7 +1563,7 @@ const QueryForm = () => {

In the `useEffect` callback, we replaced the stubbed ID array with the call to
`getAllTokenIds` function, which executed `GetAllTokenIds.cdc` and returned an
array of existing token IDs. We then call `setTokenIds` to set `allTokenIds` to
array of existing token IDs. We then call `setAllTokenIds` to set `allTokenIds` to
the array. This is used to fill up the `<option>` element with the IDs and act as
the UI guard to make sure users can only choose the available tokens to query.

Expand Down