diff --git a/src/abstraction/resources/fileResource.js b/src/abstraction/resources/fileResource.js
index 68a3557..63bd4ad 100644
--- a/src/abstraction/resources/fileResource.js
+++ b/src/abstraction/resources/fileResource.js
@@ -7,8 +7,8 @@ export const getJson = (data) => ({
export const setData = (data) => (
objectToFormData({
- media: data.media.file,
- crop: data.crop,
+ media: data.file,
+ crop_data: data.crop_data,
batch_id: data.batch_id,
collection: data.collection,
}));
diff --git a/src/components/AddProduct/Main.vue b/src/components/AddProduct/Main.vue
index 1c517dd..8b381e7 100644
--- a/src/components/AddProduct/Main.vue
+++ b/src/components/AddProduct/Main.vue
@@ -19,7 +19,7 @@
@@ -240,6 +240,7 @@ export default {
fileForm: {
batch_id: RANDOM_TOKEN,
collection: "thumbnail",
+ crop_data: {},
},
noResultsText: "No results found.",
noChildrenText: "It does not have a subset",
@@ -278,7 +279,7 @@ export default {
if (valid) {
let repository = new FileRepository();
if (this.productId) {
- if (this.fileForm.media.file) {
+ if (this.fileForm.file) {
await repository.store(this.fileForm);
}
await this.updateProduct(this.form);
@@ -298,6 +299,7 @@ export default {
async load() {
await this.loadProduct(this.productId);
this.form = this.getProduct;
+ this.form["batch_id"] = RANDOM_TOKEN;
// this.changeProductCategories();
},
removeTags(item) {
diff --git a/src/components/AddProgram/Main.vue b/src/components/AddProgram/Main.vue
index 6792cba..a894954 100644
--- a/src/components/AddProgram/Main.vue
+++ b/src/components/AddProgram/Main.vue
@@ -19,7 +19,7 @@
@@ -149,6 +149,7 @@ export default {
fileForm: {
batch_id: RANDOM_TOKEN,
collection: "thumbnail",
+ crop_data: {},
},
}),
watch: {
@@ -170,7 +171,7 @@ export default {
try {
let repository = new FileRepository();
if (this.programId) {
- if (this.fileForm.media.file) {
+ if (this.fileForm.file) {
await repository.store(this.fileForm);
}
await this.updateProgram(this.form);
diff --git a/src/components/AddWorkout/Main.vue b/src/components/AddWorkout/Main.vue
index 7096adf..2550c38 100644
--- a/src/components/AddWorkout/Main.vue
+++ b/src/components/AddWorkout/Main.vue
@@ -19,7 +19,7 @@
@@ -196,6 +196,7 @@ export default {
fileForm: {
batch_id: RANDOM_TOKEN,
collection: "thumbnail",
+ crop_data: {}
},
}),
computed: {
@@ -222,7 +223,7 @@ export default {
try {
let repository = new FileRepository();
if (this.workoutId) {
- if (this.fileForm.media.file) {
+ if (this.fileForm.file) {
await repository.store(this.fileForm);
}
await this.updateWorkout(this.form);
diff --git a/src/components/Global/Input/ImageCropper.vue b/src/components/Global/Input/ImageCropper.vue
index bb26e01..a2316fc 100644
--- a/src/components/Global/Input/ImageCropper.vue
+++ b/src/components/Global/Input/ImageCropper.vue
@@ -7,7 +7,7 @@
@change="onChangeCropper"
:src="thumbnail"
/>
-
+