Skip to content

Commit

Permalink
[Fix] 매직 넘버 상수로 분리 #32
Browse files Browse the repository at this point in the history
why
매직넘버가 가독성을 해침

how
날짜가 없을 때 데이터를 모두 조회하기 위해서 cursor에 MAX_DATE 상수 지정
  • Loading branch information
WooYeonSeo committed Nov 26, 2019
1 parent ee181e2 commit faa039d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/src/api/feed/feed.resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ const parseResult = result => {
return returnArr;
};

const DEFAUT_MAX_DATE = '9999-12-31T09:29:26.050Z';

export default {
Query: {
feeds: async (
_,
{ first, cursor = '9999-12-31T09:29:26.050Z' }: IPageParam
) => {
feeds: async (_, { first, cursor = DEFAUT_MAX_DATE }: IPageParam) => {
const result = await session.run(MATCH_NEW_FEEDS, { cursor, first });
console.log('-------cursor!!', cursor);

console.log('result.records', result.records);
const parsedResult = parseResult(result.records);
Expand Down

0 comments on commit faa039d

Please sign in to comment.