Skip to content

Commit ad8c602

Browse files
committed
Shows released_at instead of created_at in PostSequences
1 parent 8cb1c01 commit ad8c602

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

velog-backend/src/router/posts/posts.ctrl.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ export const listSequences = async (ctx: Context) => {
516516
'url_slug',
517517
'fk_user_id',
518518
'created_at',
519+
'released_at',
519520
],
520521
raw: true,
521522
});
@@ -528,7 +529,7 @@ export const listSequences = async (ctx: Context) => {
528529
// loads posts before post
529530
promises.push(Post.findAll({
530531
order: [['created_at', 'asc']],
531-
attributes: ['id', 'title', 'body', 'meta', 'url_slug', 'created_at'],
532+
attributes: ['id', 'title', 'body', 'meta', 'url_slug', 'created_at', 'released_at'],
532533
where: {
533534
fk_user_id,
534535
created_at: {
@@ -559,7 +560,7 @@ export const listSequences = async (ctx: Context) => {
559560
// loads posts after post
560561
promises.push(Post.findAll({
561562
order: [['created_at', 'desc']],
562-
attributes: ['id', 'title', 'body', 'meta', 'url_slug', 'created_at'],
563+
attributes: ['id', 'title', 'body', 'meta', 'url_slug', 'created_at', 'released_at'],
563564
where: {
564565
fk_user_id,
565566
created_at: {

velog-frontend/src/components/post/PostSequences/PostSequences.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ type Props = {
2222
};
2323

2424
const PostSequenceItem = ({ sequence, username, active }: PostSequenceItemProps) => {
25-
const { title, body, meta, url_slug, created_at } = sequence;
25+
const { title, body, meta, url_slug, released_at } = sequence;
2626
const to = `/@${username}/${url_slug}`;
2727
return (
2828
<FakeLink className={cx('PostSequenceItem', { active })} to={to}>
29-
<div className="date">{fromNow(created_at)}</div>
29+
<div className="date">{fromNow(released_at)}</div>
3030
<div className="title">
3131
<Link to={to}>{title}</Link>
3232
</div>

0 commit comments

Comments
 (0)