Fix Event and Feed type
This commit is contained in:
@@ -6,13 +6,10 @@ const url = `${process.env.API_URL}/events/`;
|
||||
|
||||
export interface Event {
|
||||
id: number;
|
||||
title: string;
|
||||
title_fi: string;
|
||||
title_en: string;
|
||||
description: string;
|
||||
description_fi: string;
|
||||
description_en: string;
|
||||
content: string;
|
||||
content_fi: string;
|
||||
content_en: string;
|
||||
start_time: string;
|
||||
|
||||
+6
-3
@@ -5,9 +5,12 @@ const url = `${process.env.API_URL}/feed/`;
|
||||
|
||||
export interface Post {
|
||||
id: number;
|
||||
title: string;
|
||||
description: string;
|
||||
content: string;
|
||||
title_fi: string;
|
||||
title_en: string;
|
||||
description_fi: string;
|
||||
description_en: string;
|
||||
content_fi: string;
|
||||
content_en: string;
|
||||
publish_time: string;
|
||||
autohide: string;
|
||||
tag_id: number[];
|
||||
|
||||
@@ -91,7 +91,7 @@ class AdminEventPage extends React.Component<AdminEventPageProps, AdminEventPage
|
||||
<tbody>
|
||||
{events.map(event => (
|
||||
<tr key={event.id}>
|
||||
<td><Anchor to={`/admin/events/${event.id}`}>{event.title}</Anchor></td>
|
||||
<td><Anchor to={`/admin/events/${event.id}`}>{event.title_fi}</Anchor></td>
|
||||
<td>{formatRelative(new Date(event.start_time), new Date())}</td>
|
||||
<td>{formatRelative(new Date(event.end_time), new Date())}</td>
|
||||
</tr>
|
||||
|
||||
@@ -91,8 +91,8 @@ class AdminFeedPage extends React.Component<AdminFeedPageProps, AdminFeedPageSta
|
||||
<tbody>
|
||||
{feed.map(post => (
|
||||
<tr key={post.id}>
|
||||
<td><Anchor to={`/admin/feed/${post.id}`}>{post.title}</Anchor></td>
|
||||
<td>{post.description}</td>
|
||||
<td><Anchor to={`/admin/feed/${post.id}`}>{post.title_fi}</Anchor></td>
|
||||
<td>{post.description_fi}</td>
|
||||
<td>{formatRelative(new Date(post.publish_time), new Date())}</td>
|
||||
</tr>
|
||||
))}
|
||||
|
||||
@@ -138,9 +138,9 @@ class FrontPage extends React.Component<FrontPageProps, FrontPageState> {
|
||||
{events.map(event => (
|
||||
<Card
|
||||
key={event.id}
|
||||
title={event.title}
|
||||
title={event.title_fi}
|
||||
start_time={event.start_time}
|
||||
text={event.description}
|
||||
text={event.description_fi}
|
||||
link={`/events/${event.id}`}
|
||||
image={event.tags[0].icon}
|
||||
button={
|
||||
@@ -172,9 +172,9 @@ class FrontPage extends React.Component<FrontPageProps, FrontPageState> {
|
||||
{feed.map(inst => (
|
||||
<Card
|
||||
key={inst.id}
|
||||
title={inst.title}
|
||||
title={inst.title_fi}
|
||||
start_time={inst.publish_time}
|
||||
text={inst.description}
|
||||
text={inst.description_fi}
|
||||
link={`/feed/${inst.id}`}
|
||||
button={
|
||||
<Button type={ButtonType.Filled} onClick={() => { }}>
|
||||
|
||||
Reference in New Issue
Block a user