Skip to content

Commit dae6f8c

Browse files
committed
fix: correct creation, suppress error when loading entity
1 parent 60ceb7f commit dae6f8c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tinect/redirects",
33
"description": "Redirect plugin for Shopware 6",
4-
"version": "0.0.12",
4+
"version": "0.0.13",
55
"type": "shopware-platform-plugin",
66
"license": "MIT",
77
"authors": [

src/Resources/app/administration/src/module/tinect-redirects/page/tinect-redirects-create/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ const { Component } = Shopware;
33
Component.extend('tinect-redirects-create', 'tinect-redirects-details', {
44
methods: {
55
getRedirect() {
6-
this.redirect = this.redirectRepository.create(Shopware.Context.api);
7-
this.redirect.httpCode = 302;
8-
this.redirect.active = false;
9-
this.redirect.hidden = 0;
6+
this.detail = this.redirectRepository.create(Shopware.Context.api);
7+
this.detail.httpCode = 302;
8+
this.detail.active = false;
9+
this.detail.hidden = false;
1010

1111
this.isLoading = false;
1212
},
1313

1414
onClickSave() {
15-
if (this.redirect.source === this.redirect.target) {
15+
if (this.detail.source === this.detail.target) {
1616
this.createNotificationError({
1717
title: this.$tc('tinect-redirects.detail.errorTitle'),
1818
message: this.$tc('tinect-redirects.detail.errorSameUrlDescription'),
@@ -21,9 +21,9 @@ Component.extend('tinect-redirects-create', 'tinect-redirects-details', {
2121
}
2222

2323
this.isLoading = true;
24-
this.redirectRepository.save(this.redirect, Shopware.Context.api).then(() => {
24+
this.redirectRepository.save(this.detail, Shopware.Context.api).then(() => {
2525
this.isLoading = false;
26-
this.$router.push({ name: 'tinect.redirects.details', params: { id: this.redirect.id } });
26+
this.$router.push({ name: 'tinect.redirects.details', params: { id: this.detail.id } });
2727
}).catch((exception) => {
2828
this.isLoading = false;
2929
this.createNotificationError({

src/Resources/app/administration/src/module/tinect-redirects/page/tinect-redirects-details/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Component.register('tinect-redirects-details', {
2525

2626
data() {
2727
return {
28-
detail: null,
28+
detail: {},
2929
isLoading: true,
3030
processSuccess: false,
3131
similarItems: null,

0 commit comments

Comments
 (0)