Skip to content

Commit

Permalink
feat: articles 添加author id字段
Browse files Browse the repository at this point in the history
  • Loading branch information
MarleneJiang committed Feb 2, 2023
1 parent d2ced62 commit b2b56e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/server/api/articles/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default defineEventHandler(async (event): Promise<IArticle> => {
const reqQuery = `query{
article(id : ${id}){
data{
id
attributes{
title
viewed
Expand All @@ -17,6 +18,7 @@ export default defineEventHandler(async (event): Promise<IArticle> => {
updatedAt
authorId{
data{
id
attributes{
name
motto
Expand Down
1 change: 1 addition & 0 deletions frontend/types/IArticle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
interface IAuthor {
id: string
name: string
motto: string
avatar: string
Expand Down

0 comments on commit b2b56e3

Please sign in to comment.