Skip to content

Commit e7b1aec

Browse files
authored
fix: infinite loading when author has no documents
fix: infinite loading when author has no documents
2 parents 1168b05 + e4713e4 commit e7b1aec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/controllers/authors.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,11 @@ exports.getAuthor = ({ params: { ORCID } }, res) => {
214214
res.status(500).json(message)
215215
})
216216
} else {
217-
res.status(500)
217+
let author_with_documents_count = author.get({ plain: true })
218+
219+
author_with_documents_count.hIndex = 0
220+
author_with_documents_count.documents_count = 0
221+
res.json(author_with_documents_count)
218222
}
219223
} else {
220224
res.sendStatus(404)

0 commit comments

Comments
 (0)