From 666b38f2f95f7ffa353927bb08c13f648400710e Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Mon, 12 Aug 2024 16:32:51 +0300 Subject: [PATCH] blob --- front/store/images.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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) {