Commit 6ae79f13 authored by ZeMKI's avatar ZeMKI

Bugfix on add tokens on New interview

* now you can add a token when you have 0 during the interview.
parent d1afc9ae
...@@ -173,7 +173,9 @@ ...@@ -173,7 +173,9 @@
}, },
fetchtoken: function (newVal, OldVal) { fetchtoken: function (newVal, OldVal) {
if (newVal) { if (newVal) {
axios.post('../api/v1/gettokens', {study: this.tokens[0].pivot.study_id}).then(response => { let urlParams = new URLSearchParams(window.location.search);
let study_id = urlParams.get('study');
axios.post('../api/v1/gettokens', {study: study_id}).then(response => {
this.tokens.push(response.data); this.tokens.push(response.data);
this.tokens[this.tokens.length - 1].valutation = { this.tokens[this.tokens.length - 1].valutation = {
......
...@@ -210,9 +210,11 @@ ...@@ -210,9 +210,11 @@
}, },
fetchtoken: function(newVal, OldVal) fetchtoken: function(newVal, OldVal)
{ {
let urlParams = new URLSearchParams(window.location.search);
let study_id = urlParams.get('study');
if (newVal) if (newVal)
{ {
axios.post('../api/v1/gettokens', {study: this.tokens[0].pivot.study_id}).then(response => axios.post('../api/v1/gettokens', {study: study_id}).then(response =>
{ {
this.tokens.push(response.data); this.tokens.push(response.data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment