Skip to content

Commit

Permalink
fix: 마지막 발행일 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyongp committed Nov 12, 2023
1 parent 5f72b51 commit 936bb96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/models/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ export interface RawAuthUser {
username: string | null;
avatarUrl: string | null;
lastSignedAt: Date | null;
lastPublishedAt?: Date | null;
_count: {
posts: number;
followers: number;
followings: number;
blogs: number;
};
blogs: {
lastPublishedAt: Date | null;
}[];
}

export function toAuthUser(raw: RawAuthUser): AuthUser {
Expand All @@ -37,7 +39,7 @@ export function toAuthUser(raw: RawAuthUser): AuthUser {
username: raw.username,
avatarUrl: raw.avatarUrl,
lastSignedAt: dateToUnixTime(raw.lastSignedAt),
lastPublishedAt: dateToUnixTime(raw.lastPublishedAt),
lastPublishedAt: dateToUnixTime(raw.blogs[0]?.lastPublishedAt),
posts: raw._count.posts,
followers: raw._count.followers,
followings: raw._count.followings,
Expand Down

0 comments on commit 936bb96

Please sign in to comment.