mirror of
https://github.com/Qortal/qortal.git
synced 2025-05-04 08:47:52 +00:00
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({
|
@ApiErrors({
|
||||||
ApiError.REPOSITORY_ISSUE
|
ApiError.REPOSITORY_ISSUE
|
||||||
})
|
})
|
||||||
public List<AssetData> getAllAssets(@Parameter(
|
public List<AssetData> getAllAssets(@QueryParam("includeData") Boolean includeData,
|
||||||
|
@Parameter(
|
||||||
ref = "limit"
|
ref = "limit"
|
||||||
) @QueryParam("limit") Integer limit, @Parameter(
|
) @QueryParam("limit") Integer limit, @Parameter(
|
||||||
ref = "offset"
|
ref = "offset"
|
||||||
@ -102,6 +103,7 @@ public class AssetsResource {
|
|||||||
try (final Repository repository = RepositoryManager.getRepository()) {
|
try (final Repository repository = RepositoryManager.getRepository()) {
|
||||||
List<AssetData> assets = repository.getAssetRepository().getAllAssets(limit, offset, reverse);
|
List<AssetData> assets = repository.getAssetRepository().getAllAssets(limit, offset, reverse);
|
||||||
|
|
||||||
|
if (includeData == null || !includeData)
|
||||||
assets.forEach(asset -> asset.setData(null));
|
assets.forEach(asset -> asset.setData(null));
|
||||||
|
|
||||||
return assets;
|
return assets;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user