test
This commit is contained in:
@@ -335,6 +335,7 @@
|
||||
<div class="text-center">
|
||||
<img
|
||||
id="uploadPreview"
|
||||
:src="getPosterPreview()"
|
||||
style="
|
||||
width: 300px;
|
||||
height: auto;
|
||||
@@ -1172,6 +1173,12 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
getPosterPreview() {
|
||||
if (this.product.poster instanceof File) {
|
||||
return URL.createObjectURL(this.product.poster);
|
||||
}
|
||||
return this.product.poster;
|
||||
},
|
||||
async StoreProduct() {
|
||||
const header = {
|
||||
headers: {
|
||||
@@ -1263,10 +1270,25 @@ export default {
|
||||
screens < this.product.colors[i].screens.length;
|
||||
screens++
|
||||
) {
|
||||
formData.append(
|
||||
"colors[" + i + "][screens][" + screens + "][image]",
|
||||
this.product.colors[i].screens[screens].file
|
||||
);
|
||||
if (this.product.colors[i].screens[screens].file) {
|
||||
formData.append(
|
||||
"colors[" + i + "][screens][" + screens + "][image]",
|
||||
this.product.colors[i].screens[screens].file
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.product.colors[i].filesDataForUpload) {
|
||||
for (
|
||||
let f = 0;
|
||||
f < this.product.colors[i].filesDataForUpload.length;
|
||||
f++
|
||||
) {
|
||||
formData.append(
|
||||
"colors[" + i + "][screens][new_" + f + "][image]",
|
||||
this.product.colors[i].filesDataForUpload[f].file
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user