diff --git a/front/store/images.ts b/front/store/images.ts index d126ab8..459c8dd 100644 --- a/front/store/images.ts +++ b/front/store/images.ts @@ -25,14 +25,16 @@ export const useImagesStore = defineStore('images', { if (this.list[name].type == 'tg') { file_url_data = await apiCall(`tgbot/items/get_image/${name}/`) + if (file_url_data.length > 0 && file_url_data[0] !== null) { + this.list[name].status = 'success' + this.list[name].result = file_url_data[0] + } else { + this.list[name].status = 'error' + } } else if (this.list[name].type == 'aws') { file_url_data = await apiCall(`tgbot/items/get_image_s3/${name}/`) - } - if (file_url_data.length > 0 && file_url_data[0] !== null) { + this.list[name].result = URL.createObjectURL(file_url_data); this.list[name].status = 'success' - this.list[name].result = file_url_data[0] - } else { - this.list[name].status = 'error' } if (Object.entries(this.list).filter(el => el[1].status == 'idle').length) {