From 3d7f17c61864af441cece911c3b4a9c225862982 Mon Sep 17 00:00:00 2001 From: VividTruthKeeper Date: Fri, 30 Sep 2022 14:37:09 +0500 Subject: [PATCH] created updated fields added --- src/pages/Post.tsx | 33 +++++++++++++++++++++++++++++++-- src/types/links.ts | 2 +- src/types/posts.ts | 4 ++-- src/types/sources.ts | 2 +- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/pages/Post.tsx b/src/pages/Post.tsx index 289bb4b..8522341 100644 --- a/src/pages/Post.tsx +++ b/src/pages/Post.tsx @@ -44,6 +44,7 @@ const Post = () => {

{postData ? postData.title : ""}

+

Publish date:

{postData ? postData.publish_date @@ -70,6 +71,34 @@ const Post = () => { value={postData ? postData.summary : ""} >

+
+

Created

+ +
+
+

Updated

+ +
{ {`${parseDate(History.created_at)[0]}, ${ parseDate(History.created_at)[1] }`} - {`${parseDate(History.updatedAt)[0]}, ${ - parseDate(History.updatedAt)[1] + {`${parseDate(History.updated_at)[0]}, ${ + parseDate(History.updated_at)[1] }`} ); diff --git a/src/types/links.ts b/src/types/links.ts index bb9df73..a3faac1 100644 --- a/src/types/links.ts +++ b/src/types/links.ts @@ -3,5 +3,5 @@ export interface LinksAll { name: string; source: string; created_at: Date; - updatedAt: Date; + updated_at: Date; } diff --git a/src/types/posts.ts b/src/types/posts.ts index 233ad4c..15bdc83 100644 --- a/src/types/posts.ts +++ b/src/types/posts.ts @@ -3,7 +3,7 @@ export interface HistoryList { new_published_at: Date; PostID: number; created_at: Date; - updatedAt: Date; + updated_at: Date; } export interface PostType { id: number; @@ -13,7 +13,7 @@ export interface PostType { publish_date: Date; summary: string; created_at: Date; - updatedAt: Date; + updated_at: Date; HistoryList: HistoryList[]; } diff --git a/src/types/sources.ts b/src/types/sources.ts index 7ef5725..df0e131 100644 --- a/src/types/sources.ts +++ b/src/types/sources.ts @@ -3,7 +3,7 @@ export interface SourceType { name: string; source: string; created_at: Date; - updatedAt: Date; + updated_at: Date; } export interface SourceEditDataType {