forked from Qortal/qortal
For API "GET /assets" add optional query param "includeData"
This commit is contained in:
parent
97142fdde8
commit
7026c35e73
@ -92,7 +92,8 @@ public class AssetsResource {
|
||||
@ApiErrors({
|
||||
ApiError.REPOSITORY_ISSUE
|
||||
})
|
||||
public List<AssetData> getAllAssets(@Parameter(
|
||||
public List<AssetData> getAllAssets(@QueryParam("includeData") Boolean includeData,
|
||||
@Parameter(
|
||||
ref = "limit"
|
||||
) @QueryParam("limit") Integer limit, @Parameter(
|
||||
ref = "offset"
|
||||
@ -102,6 +103,7 @@ public class AssetsResource {
|
||||
try (final Repository repository = RepositoryManager.getRepository()) {
|
||||
List<AssetData> assets = repository.getAssetRepository().getAllAssets(limit, offset, reverse);
|
||||
|
||||
if (includeData == null || !includeData)
|
||||
assets.forEach(asset -> asset.setData(null));
|
||||
|
||||
return assets;
|
||||
|
Loading…
x
Reference in New Issue
Block a user