-
Notifications
You must be signed in to change notification settings - Fork 53
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
base: master
Are you sure you want to change the base?
Conversation
__tests__/integration/wallet.spec.js
Outdated
const chai = require("chai"); | ||
const server = require("../../server/app"); | ||
chai.use(require('chai-uuid')); | ||
const Zaven = require("../mock-data/Zaven.json"); |
There was a problem hiding this comment.
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?
server/routes/walletRouter.js
Outdated
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)) |
There was a problem hiding this comment.
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){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
@ZavenArra new commits removed your name, and set offset to start with 0. |
No description provided.