Skip to content

Commit acd3d46

Browse files
authored
Merge pull request #340 from azujuuuuuun/feature/update-model
Update feed model
2 parents 748cd5d + 7c38e40 commit acd3d46

File tree

3 files changed

+6
-40
lines changed

3 files changed

+6
-40
lines changed

src/components/modules/Blog/Blog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const Blog: React.FC<BlogProps> = ({ className, feed }) => {
2222
</time>
2323
<a
2424
className="ml-xs"
25-
href={e.link[0].href}
25+
href={e.link.href}
2626
target="_blank"
2727
rel="noreferrer noopener"
2828
>

src/domain/blog/model.fixture.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,11 @@ import type { Entry, Feed } from "./model";
33
export const getEntryFixture = (entry?: Partial<Entry>): Entry => {
44
return {
55
title: "Entry title",
6-
link: [
7-
{
8-
href: "https://example.com/",
9-
},
10-
],
6+
link: {
7+
href: "https://example.com/",
8+
},
119
id: "Entry id",
1210
published: "2022-09-10T00:00:00+09:00",
13-
updated: "2022-09-10T00:00:00+09:00",
14-
summary: "Entry summary",
15-
content: "Entry content",
16-
category: {
17-
term: "Category term",
18-
label: "Category label",
19-
},
20-
author: {
21-
name: "Author name",
22-
},
2311
...entry,
2412
};
2513
};
@@ -32,10 +20,6 @@ export const getFeedFixture = (feed?: Partial<Feed>): Feed => {
3220
href: "https://example.com/",
3321
},
3422
updated: "2022-09-10T00:00:0+09:00",
35-
author: {
36-
name: "Author name",
37-
},
38-
id: "Blog id",
3923
entry: [getEntryFixture()],
4024
...feed,
4125
};

src/domain/blog/model.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,14 @@
11
export interface Entry {
22
title: string;
3-
link: {
4-
href: string;
5-
}[];
3+
link: { href: string };
64
id: string;
75
published: string;
8-
updated: string;
9-
summary: string;
10-
content: string;
11-
category: {
12-
term: string;
13-
label: string;
14-
};
15-
author: {
16-
name: string;
17-
};
186
}
197

208
export interface Feed {
219
title: string;
2210
subTitle: string;
23-
link: {
24-
href: string;
25-
};
11+
link: { href: string };
2612
updated: string;
27-
author: {
28-
name: string;
29-
};
30-
id: string;
3113
entry: Entry[];
3214
}

0 commit comments

Comments
 (0)