Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Commit 2c92fcb

Browse files
author
eburtin
committed
Fix method for fetching all images in light version with no argument
1 parent 58025b4 commit 2c92fcb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/collections/image-instance-collection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default class ImageInstanceCollection extends Collection {
4646
* @returns {Array<{id: Number, filename: String, originalFilename: String, projectName: String, project: Number}>}
4747
* The list of images (light format)
4848
*/
49-
static async fetchAllLight({max=0, offset=0}) {
49+
static async fetchAllLight({max=0, offset=0}={}) {
5050
let {data} = await Cytomine.instance.api.get(`user/0/imageinstance/light.json?max=${max}&offset=${offset}`); // {user} value ignored in backend => set to 0
5151
return data.collection;
5252
}

tests/test-image-instance.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ describe("ImageInstance", function() {
226226
expect(listId).to.include(image.id);
227227
});
228228
});
229+
230+
it("Fetch light version", async function() {
231+
let collection = await ImageInstanceCollection.fetchAllLight();
232+
expect(collection).to.have.lengthOf.at.least(nbImageInstances);
233+
});
229234
});
230235

231236
describe("Working with the collection", function() {

0 commit comments

Comments
 (0)