Skip to content
Snippets Groups Projects
Commit e048e868 authored by Trirst's avatar Trirst
Browse files

Fix secret header

parent f52da7e6
No related branches found
No related tags found
No related merge requests found
Pipeline #764 failed
......@@ -27,7 +27,7 @@ export default {
},
},
computed: {
...mapState(["stateSecret"]),
...mapState(["stateUser"]),
},
methods: {
appendToDeleteArray(...args) {
......@@ -39,7 +39,7 @@ export default {
deleteImages(deleteArray) {
const options = {
method: "DELETE",
headers: { secret: this.stateSecret },
headers: { secret: this.stateUser.secret },
};
for (let i = 0; i < deleteArray.length; i++) {
fetch(`/api/image/${deleteArray[i]}`, options);
......
......@@ -50,14 +50,14 @@ export default {
}
return false;
},
...mapState(["stateSecret"]),
...mapState(["stateUser"]),
},
methods: {
setTag() {
fetch(`/api/tag/${this.tag}`, {
method: "PUT",
headers: {
secret: this.stateSecret,
secret: this.stateUser.secret,
},
})
.then((response) => {
......@@ -70,7 +70,7 @@ export default {
method: "PATCH",
headers: {
"Content-Type": "application/json",
secret: this.stateSecret,
secret: this.stateUser.secret,
},
body: JSON.stringify({ type: this.tagType }),
};
......@@ -78,12 +78,6 @@ export default {
.then((response) => console.log(response))
.catch((error) => console.error(error));
},
// setTagAndType() {
// const regex = /^[a-z0-9()_-]*$/g;
// if (!this.tag.match(regex)) {
// console.log("Tag doesn't match regex");
// }
// },
resetTagAndType() {
this.tag = "";
this.tagType = "generic";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment