diff --git a/science-quest/src/data/scientifique.js b/science-quest/src/data/scientifique.js index 56f26b0..8907588 100644 --- a/science-quest/src/data/scientifique.js +++ b/science-quest/src/data/scientifique.js @@ -17,8 +17,12 @@ export class Scientifiques extends PagedDataObject{ constructor(parsedJSON){ super(parsedJSON, Scientifique) } - static async getPage(pageNb, size=10){ - const response = await fetch(`${REST_API}/scientifiques?page=${pageNb}&size=${size}`) + static async getPage(pageNb, size=0){ + let sizeParam="" + if(size>=0){ + sizeParam=`&size=${size}` + } + const response = await fetch(`${REST_API}/scientifiques?page=${pageNb}${sizeParam}`) return new this(await response.json()) } }