mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Updates
This commit is contained in:
@@ -26,8 +26,8 @@ const genAssetsByID = (context, ids) => AssetModel.find({
|
||||
* @param {Number} limit limit the number of results
|
||||
* @return {Promise} resolves the assets
|
||||
*/
|
||||
const getAssetsByQuery = (context, value, limit) => {
|
||||
return AssetsService.search(value, null, limit);
|
||||
const getAssetsByQuery = (context, query) => {
|
||||
return AssetsService.search(query);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,9 +11,7 @@ const RootQuery = {
|
||||
return null;
|
||||
}
|
||||
|
||||
const {value = '', limit} = query;
|
||||
|
||||
return Assets.search(value, limit);
|
||||
return Assets.search(query);
|
||||
},
|
||||
asset(_, query, {loaders: {Assets}}) {
|
||||
if (query.id) {
|
||||
|
||||
@@ -634,7 +634,7 @@ type RootQuery {
|
||||
comment(id: ID!): Comment
|
||||
|
||||
# All assets. Requires the `ADMIN` role.
|
||||
assets(query: AssetsQuery!): [Asset]
|
||||
assets(query: AssetsQuery): [Asset]
|
||||
|
||||
# Find or create an asset by url, or just find with the ID.
|
||||
asset(id: ID, url: String): Asset
|
||||
|
||||
Reference in New Issue
Block a user