Bug : not adding to history and a failed request, fixed.

This commit is contained in:
izerozlu
2019-08-30 09:56:52 +03:00
parent e0dc8ea46d
commit a3f8abba1a
2 changed files with 13 additions and 1 deletions

View File

@@ -74,6 +74,7 @@
},
addEntry(entry) {
this.history.push(entry);
updateOnLocalStorage('history', this.history);
}
}
}

View File

@@ -416,7 +416,18 @@
this.response.headers = error.response.headers;
this.response.status = error.response.status;
this.response.body = error.response.data;
return;
// Addition of an entry to the history component.
const entry = {
status: this.response.status,
date: new Date().toLocaleDateString(),
time: new Date().toLocaleTimeString(),
method: this.method,
url: this.url,
path: this.path
};
this.$refs.historyComponent.addEntry(entry);
return;
}
this.response.status = error.message;