mirror of
https://github.com/wassname/talk.git
synced 2026-07-10 15:56:33 +08:00
Using async await
This commit is contained in:
@@ -4,11 +4,13 @@ const Asset = {
|
||||
recentComments({id}, _, {loaders: {Comments}}) {
|
||||
return Comments.genRecentComments.load(id);
|
||||
},
|
||||
comment({id}, {id: commentId}, {loaders: {Comments}}) {
|
||||
return Comments.getByQuery({
|
||||
async comment({id}, {id: commentId}, {loaders: {Comments}}) {
|
||||
const comments = await Comments.getByQuery({
|
||||
asset_id: id,
|
||||
ids: commentId
|
||||
}).then((c) => c.nodes[0]);
|
||||
});
|
||||
|
||||
return comments.nodes[0];
|
||||
},
|
||||
comments({id}, {sort, limit, deep, excludeIgnored, tags}, {loaders: {Comments}}) {
|
||||
return Comments.getByQuery({
|
||||
|
||||
Reference in New Issue
Block a user