Skip to content

Commit 1d6a3f3

Browse files
committed
remove weird and unncessary collectionId param to populateTemporalExtentIfMissing
1 parent f60be36 commit 1d6a3f3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/lib/api.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,12 +1256,11 @@ const deleteUnusedFields = (collection) => {
12561256
/**
12571257
* Populate temporal extent for a collection from its items if not already defined
12581258
* @param {Object} backend - Database backend
1259-
* @param {Object} collection - Collection object to populate
1260-
* @param {string} [collectionId] - Collection ID (defaults to collection.id)
1259+
* @param {Object} collection - Collection object
12611260
* @returns {Promise<void>}
12621261
*/
1263-
const populateTemporalExtentIfMissing = async (backend, collection, collectionId = undefined) => {
1264-
const id = collectionId || collection.id
1262+
const populateTemporalExtentIfMissing = async (backend, collection) => {
1263+
const id = collection.id
12651264

12661265
// Check if collection already has a temporal extent defined
12671266
const hasTemporalExtent = collection.extent?.temporal?.interval?.[0]?.[0] !== undefined
@@ -1297,7 +1296,7 @@ const getCollections = async function (backend, endpoint, parameters, headers) {
12971296

12981297
// Populate temporal extent for each collection from items only if not already defined
12991298
await Promise.all(collections.map((collection) =>
1300-
populateTemporalExtentIfMissing(backend, collection, undefined)))
1299+
populateTemporalExtentIfMissing(backend, collection)))
13011300

13021301
for (const collection of collections) {
13031302
deleteUnusedFields(collection)
@@ -1345,7 +1344,7 @@ const getCollection = async function (backend, collectionId, endpoint, parameter
13451344
}
13461345

13471346
// Populate temporal extent from items only if not already defined
1348-
await populateTemporalExtentIfMissing(backend, result, collectionId)
1347+
await populateTemporalExtentIfMissing(backend, result)
13491348

13501349
deleteUnusedFields(result)
13511350

0 commit comments

Comments
 (0)