mirror of
https://github.com/wassname/talk.git
synced 2026-07-14 11:18:50 +08:00
updated
This commit is contained in:
@@ -71,9 +71,7 @@ const findByUrl = async (context, asset_url) => {
|
||||
throw errors.ErrInvalidAssetURL;
|
||||
}
|
||||
|
||||
let asset = await AssetsService.findByUrl(asset_url);
|
||||
|
||||
return asset;
|
||||
return AssetsService.findByUrl(asset_url);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,11 +53,10 @@ const RootQuery = {
|
||||
}
|
||||
|
||||
if (asset_url) {
|
||||
return Assets.findByUrl(asset_url)
|
||||
.then((asset) => {
|
||||
const newQuery = Object.assign({}, query, {asset_id: asset.id});
|
||||
return Comments.getCountByQuery(newQuery);
|
||||
});
|
||||
let asset = await Assets.findByUrl(asset_url);
|
||||
if (asset) {
|
||||
query.asset_id = asset.id;
|
||||
}
|
||||
}
|
||||
|
||||
return Comments.getCountByQuery(query);
|
||||
|
||||
Reference in New Issue
Block a user