Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-calavera committed Oct 17, 2019
1 parent e9edead commit 5255e3c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 18 deletions.
14 changes: 12 additions & 2 deletions api/loaders/accounts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@ function parseAccountEntry(data) {
* @returns {Promise<{timelinePage: *, timelineInfo: *}>}
*/
export async function loadAccountIndex(redisX, start, count, direction) {
const timelineInfo = await getRecencySetInfo(redisX, 'accounts', parseAccountEntry);
const timelineInfo = await getRecencySetInfo(
redisX,
'accounts',
parseAccountEntry,
);

const timelinePage = await getRecencySetPage(redisX, 'accounts', start, count, direction);
const timelinePage = await getRecencySetPage(
redisX,
'accounts',
start,
count,
direction,
);

return {
timelineInfo,
Expand Down
14 changes: 12 additions & 2 deletions api/loaders/applications/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@ function parseApplicationEntry(data) {
* @returns {Promise<{timelinePage: *, timelineInfo: *}>}
*/
export async function loadApplicationIndex(redisX, start, count, direction) {
const timelineInfo = await getRecencySetInfo(redisX, 'applications', parseApplicationEntry);
const timelineInfo = await getRecencySetInfo(
redisX,
'applications',
parseApplicationEntry,
);

const timelinePage = await getRecencySetPage(redisX, 'applications', start, count, direction);
const timelinePage = await getRecencySetPage(
redisX,
'applications',
start,
count,
direction,
);

return {
timelineInfo,
Expand Down
14 changes: 12 additions & 2 deletions api/loaders/recency.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ export const DEFAULT_PAGE_SIZE = 100;
* @param parseFunction
* @returns {Promise<{dt: *, last: *, count: *, timeline: *, first: *}>}
*/
export async function getRecencySetInfo(redisX, timeline, parseFunction = (x) => x) {
export async function getRecencySetInfo(
redisX,
timeline,
parseFunction = x => x,
) {
const timelineKey = `!__recent:${timeline}`;

const thePromise = new Promise((resolve, reject) => {
Expand Down Expand Up @@ -64,7 +68,13 @@ export async function getRecencySetInfo(redisX, timeline, parseFunction = (x) =>
* @param direction
* @returns {Promise<{next: *, dt: *, prev: *, start: *, length: *, count: *, timeline: *, results: *}>}
*/
export async function getRecencySetPage(redisX, timeline, start, count, direction) {
export async function getRecencySetPage(
redisX,
timeline,
start,
count,
direction,
) {
const timelineKey = `!__recent:${timeline}`;
const safeCount = Math.min(MAX_PAGE_SIZE, Math.max(0, count));
const safeStart = start ? parseInt(start) : 0;
Expand Down
12 changes: 2 additions & 10 deletions api/network-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,7 @@ export function addNetworkExplorerRoutes(redisX, app) {
const count = q.count ? parseInt(q.count) : DEFAULT_PAGE_SIZE;
const direction = q.direction || '-';
const {__errors__, rawData} = await new FriendlyGet()
.with(
'rawData',
loadAccountIndex(redisX, start, count, direction),
{},
)
.with('rawData', loadAccountIndex(redisX, start, count, direction), {})
.get();

res.send(
Expand All @@ -214,11 +210,7 @@ export function addNetworkExplorerRoutes(redisX, app) {

const version = q.v || 'AccountDetailView@latest';
const {__errors__, rawData} = await new FriendlyGet()
.with(
'rawData',
loadAccountDetail(redisX, req.params.id, version),
{},
)
.with('rawData', loadAccountDetail(redisX, req.params.id, version), {})
.get();

res.send(
Expand Down
2 changes: 1 addition & 1 deletion src/v2/api/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const ACCOUNT_DETAIL_VERSION = '[email protected]';
export function apiGetAccountDetail({accountId, version}) {
return api(
`/explorer/accounts/${encodeURIComponent(accountId)}?v=${version ||
ACCOUNT_DETAIL_VERSION}`,
ACCOUNT_DETAIL_VERSION}`,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export default makeStyles(theme => ({
borderRadius: 0,
padding: 11,
whiteSpace: 'nowrap',
maxWidth: '100%'
maxWidth: '100%',
},
}));

0 comments on commit 5255e3c

Please sign in to comment.