Skip to content

Commit 1a3a8c9

Browse files
committed
fix: ReadPost 객체 참조 문제
1 parent e842593 commit 1a3a8c9

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

api/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ const fetchReadPost = require('../src/fetchers/readpost-fetcher');
77
module.exports = async (req, res) => {
88
const { name, tag, color, slug } = req.query;
99
res.setHeader('Content-Type', 'image/svg+xml');
10-
console.log(slug)
1110
try{
1211
const post = !slug ? await fetchPost(name, tag) : await fetchReadPost(name, slug);
13-
console.log(post);
1412
return res.send(color==='dark' ? createCardDark(post) : createCard(post))
1513
} catch(e){
1614
return res.send(e.message)

src/fetchers/readpost-fetcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const fetcher = (variables) => {
3333
async function fetchReadPost(name, slug) {
3434
try{
3535
const { data } = await fetcher({"username": name, "url_slug" : slug});
36-
return data.data.posts;
36+
return data.data.post;
3737
}catch(e){
3838
throw new Error(e)
3939
}

0 commit comments

Comments
 (0)