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

feat: using SQL to handle the wallet list; #260

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dadiorchen
Copy link
Collaborator

No description provided.

@dadiorchen dadiorchen marked this pull request as ready for review August 19, 2021 06:58
const chai = require("chai");
const server = require("../../server/app");
chai.use(require('chai-uuid'));
const Zaven = require("../mock-data/Zaven.json");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a generic title here rather than my name?

const numBegin = numStart ? numStart - 1 : 0;
const numEnd = numBegin + numLimit;
walletsJson = walletsJson.slice(numBegin, numEnd);
const walletsJson = await walletService.getSubWalletList(res.locals.wallet_id, parseInt(offset || 1) - 1, parseInt(limit))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fix this so that the offset send in the request starts with 0 as per normal practice, that than '1'

* A faster way to get sub wallet list directly, from DB, and count
* the token in these wallet
*/
async getSubWalletList(walletId, offset, limit){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@dadiorchen
Copy link
Collaborator Author

@ZavenArra new commits removed your name, and set offset to start with 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants