Refactor with less awaits (WIP)

This commit is contained in:
2025-02-19 10:48:19 +01:00
parent 64af485a54
commit 13d6004fe8
3 changed files with 24 additions and 35 deletions

View File

@@ -67,12 +67,17 @@ export class Finding {
return content;
}
async setImages() {
/**
* @param {HTMLElement} imageContainer
* @param {Function} gallery
*/
async setImages(imageContainer, gallery) {
let record = await this.fetchData(`${window.API_URL}/finding/${this._data.id}`)
if (record.images.length) {
this.images = record.images;
imageContainer.innerHTML = this.renderImages();
gallery('finding-gallery', this.images);
}
}
/**