diff --git a/__tests__/test.json b/__tests__/test.json new file mode 100644 index 00000000..5a5a7e3b --- /dev/null +++ b/__tests__/test.json @@ -0,0 +1,51 @@ +{ + "nyplAPI": { + "request": { + "query": "Search" + }, + "response": { + "headers": { + "status": "success", + "code": "200", + "message": "ok" + }, + "name": "Billy Rose Theatre Division", + "slug": "billy-rose-theatre-division", + "summary": "The Billy Rose Theatre Division of The New York Public Library is one of the largest and most comprehensive archives devoted to the theatrical arts. Encompassing dramatic performance in all its diversity, the division is an indispensable resource for artists, writers, researchers, scholars, students, and the general public.", + "nyplLink": "https://www.nypl.org/locations/lpa/billy-rose-theatre-division", + "numFound": "218", + "perPage": "48", + "page": "1", + "items": [ + { + "title": "Publicity photograph of Maxine Elliott", + "uuid": "da343760-632a-013d-3a3b-0242ac110002", + "url": "https://digitalcollections.nypl.org/items/da343760-632a-013d-3a3b-0242ac110002", + "imageID": "58928240", + "containsMultipleImages": "true" + }, + { + "title": "Mark Short, Mary Mannering, and Charles Richman in the stage production A Man's World", + "uuid": "22b8e920-632a-013d-4265-0242ac110003", + "url": "https://digitalcollections.nypl.org/items/22b8e920-632a-013d-4265-0242ac110003", + "imageID": "58928238", + "containsMultipleImages": "true" + }, + { + "title": "Yaphet Kotto, Jimmy Pelham, and Maria Tucci in the stage production The Great White Hope", + "uuid": "ef2645d0-4eb3-013d-b578-0242ac110003", + "url": "https://digitalcollections.nypl.org/items/ef2645d0-4eb3-013d-b578-0242ac110003", + "imageID": "58926705", + "containsMultipleImages": "true" + }, + { + "title": "Yaphet Kotto and Maria Tucci in the stage production The Great White Hope", + "uuid": "95d7c270-4eb3-013d-67ad-0242ac110003", + "url": "https://digitalcollections.nypl.org/items/95d7c270-4eb3-013d-67ad-0242ac110003", + "imageID": "58926707", + "containsMultipleImages": "true" + } + ] + } + } +} \ No newline at end of file diff --git a/app/src/utils/api.ts b/app/src/utils/api.ts index eacbc02f..95b3d21f 100644 --- a/app/src/utils/api.ts +++ b/app/src/utils/api.ts @@ -260,6 +260,7 @@ export const getCollectionsData = async ({ perPage?: number; // OPEN QUESTION: perhaps remove the "perPage" field because the API default is 48 and that is what we want. } = {}) => { let apiUrl = `${process.env.API_URL}/api/v2/collections?page=${pageNum}&per_page=${perPage}&sort=${collectionsSortOptions[sortID]}&q=${keyword}`; + console.log("apiUrl is: ", apiUrl); const res = await apiResponse(apiUrl); return res; };