Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
fix : 페이지네이션 반환값 수정 (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonyaeyoon authored Feb 12, 2024
2 parents 56f0bd7 + 0d5c720 commit f87cc72
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/map/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ export class MapService {
if (endIndex < scheduleList.length) {
nextCursor = endIndex;
}
const total = scheduleList.length;
const hasNextData = endIndex < total;
const meta = {
take: options.pageSize,
total: total,
hasNextData: hasNextData,
cursor: nextCursor,
};

// 다음 페이지를 위한 커서 값 계산
// const nextCursor = Number(options.cursor) + Number(options.pageSize);
Expand All @@ -75,8 +83,8 @@ export class MapService {
data: response(BaseResponse.GET_SCHEDULE_SUCCESS, {
journeyInfo,
paginatedSchedules,
meta,
}),
nextCursor: nextCursor,
};
}

Expand Down

0 comments on commit f87cc72

Please sign in to comment.