Refactor with less awaits (WIP)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user