Skip to content

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

Open
dadiorchen wants to merge 4 commits intoGreenstand:masterfrom
dadiorchen:subwallet
Open

feat: using SQL to handle the wallet list;#260
dadiorchen wants to merge 4 commits intoGreenstand:masterfrom
dadiorchen:subwallet

Conversation

@dadiorchen
Copy link
Collaborator

No description provided.

@dadiorchen dadiorchen marked this pull request as ready for review August 19, 2021 06:58
@dadiorchen dadiorchen requested a review from ZavenArra 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