This commit is contained in:
Kseninia Mikhaylova 2024-08-12 16:32:51 +03:00
parent 18ecaea6af
commit 666b38f2f9
1 changed files with 7 additions and 5 deletions

View File

@ -25,15 +25,17 @@ export const useImagesStore = defineStore('images', {
if (this.list[name].type == 'tg') {
file_url_data = await apiCall<string[]>(`tgbot/items/get_image/${name}/`)
} else if (this.list[name].type == 'aws') {
file_url_data = await apiCall<string[]>(`tgbot/items/get_image_s3/${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<string[]>(`tgbot/items/get_image_s3/${name}/`)
this.list[name].result = URL.createObjectURL(file_url_data);
this.list[name].status = 'success'
}
if (Object.entries(this.list).filter(el => el[1].status == 'idle').length) {
this.loadImages()