Add a type for the Keycard blog

This commit is contained in:
jinhojang6 2020-06-26 01:18:48 +09:00
parent 77d104d51b
commit 5f1ce8ad3a
1 changed files with 10 additions and 1 deletions

View File

@ -68,6 +68,15 @@ interface SubspaceBlog {
url: string;
}
interface KeycardBlog {
title: string;
published_at: string;
primary_author: any;
excerpt: string;
feature_image: string;
url: string;
}
export const FetchEmbark = async () => {
await fetch(`${embarkBlog}`)
.then(response => response.text())
@ -165,7 +174,7 @@ export const FetchKeycard = async () => {
.then(response => response.json())
.then(data => {
keycardData = data.posts
keycardData.forEach((entry: keycardBlog) => {
keycardData.forEach((entry: KeycardBlog) => {
const postData: any = {}
postData.title = entry.title;
postData.published_at = entry.published_at;