sajjad 3 years ago
parent 2126395698
commit 619d6bbc7c

@ -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,
}));

@ -19,7 +19,7 @@
<ImageCropper
label="manager image"
:url.sync="form.thumbnail"
v-model="fileForm.media"
v-model="fileForm"
/>
</div>
</div>
@ -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) {

@ -19,7 +19,7 @@
<ImageCropper
label="manager image"
:url.sync="form.thumbnail"
v-model="fileForm.media"
v-model="fileForm"
/>
</div>
</div>
@ -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);

@ -19,7 +19,7 @@
<ImageCropper
label="manager image"
:url.sync="form.thumbnail"
v-model="fileForm.media"
v-model="fileForm"
/>
</div>
</div>
@ -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);

@ -7,7 +7,7 @@
@change="onChangeCropper"
:src="thumbnail"
/>
<!-- <img :src="thumbnail" alt="new brand image"/>-->
<!-- <img :src="thumbnail" alt="new brand image"/>-->
</div>
<div class="wa__modal__form">
<div>
@ -61,8 +61,8 @@ export default {
stencilProps: {
default: () => ({ aspectRatio: 1, checkImageOrigin: false }),
},
crop: {
default: () => [],
crop_data: {
default: () => {},
},
label: {
default: "",
@ -104,7 +104,7 @@ export default {
}
},
onChangeCropper({ coordinates }) {
this.form = { ...this.value, ...{ crop: coordinates } };
this.form = { ...this.value, ...{ crop_data: coordinates } };
},
},
};

Loading…
Cancel
Save