fix: send auth token with monographs get request

This commit is contained in:
thecodrr
2021-06-15 11:07:47 +05:00
parent da950b1bf1
commit 1adbde5833

View File

@@ -16,7 +16,10 @@ class Monograph {
const token = await this._db.user.tokenManager.getAccessToken(); const token = await this._db.user.tokenManager.getAccessToken();
if (!user || !token || !user.isEmailConfirmed) return; if (!user || !token || !user.isEmailConfirmed) return;
try { try {
const userMonographs = await http.get(`${Constants.API_HOST}/monographs`); const userMonographs = await http.get(
`${Constants.API_HOST}/monographs`,
token
);
this.monographs = userMonographs.reduce((prev, curr) => { this.monographs = userMonographs.reduce((prev, curr) => {
prev[curr.noteId] = curr.id; prev[curr.noteId] = curr.id;
return prev; return prev;