diff options
author | 2021-06-05 07:58:00 +0530 | |
---|---|---|
committer | 2021-06-05 08:03:31 +0530 | |
commit | 368471dba24587415cae04ca33879404fb8639a5 (patch) | |
tree | b216754eed7d6f478ceefea9ef3c0ab5698581d4 /src/api/server/ServerApi.js | |
parent | Upgraded electron to '13.1.1'. (diff) | |
download | ferdium-app-368471dba24587415cae04ca33879404fb8639a5.tar.gz ferdium-app-368471dba24587415cae04ca33879404fb8639a5.tar.zst ferdium-app-368471dba24587415cae04ca33879404fb8639a5.zip |
Reused commonly defined method for 'apiBase'
Diffstat (limited to 'src/api/server/ServerApi.js')
-rw-r--r-- | src/api/server/ServerApi.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js index 5fd5268ce..5365f9dbe 100644 --- a/src/api/server/ServerApi.js +++ b/src/api/server/ServerApi.js | |||
@@ -457,7 +457,7 @@ export default class ServerApi { | |||
457 | 457 | ||
458 | // News | 458 | // News |
459 | async getLatestNews() { | 459 | async getLatestNews() { |
460 | const url = `https://api.getferdi.com/v1/news?platform=${os.platform()}&arch=${os.arch()}&version=${app.getVersion()}`; | 460 | const url = `${apiBase(true)}/news?platform=${os.platform()}&arch=${os.arch()}&version=${app.getVersion()}`; |
461 | const request = await sendAuthRequest(url); | 461 | const request = await sendAuthRequest(url); |
462 | if (!request.ok) throw request; | 462 | if (!request.ok) throw request; |
463 | const data = await request.json(); | 463 | const data = await request.json(); |
@@ -467,7 +467,7 @@ export default class ServerApi { | |||
467 | } | 467 | } |
468 | 468 | ||
469 | async hideNews(id) { | 469 | async hideNews(id) { |
470 | const request = await sendAuthRequest(`https://api.getferdi.com/v1/news/${id}/read`); | 470 | const request = await sendAuthRequest(`${apiBase(true)}/news/${id}/read`); |
471 | if (!request.ok) throw request; | 471 | if (!request.ok) throw request; |
472 | debug('ServerApi::hideNews resolves', id); | 472 | debug('ServerApi::hideNews resolves', id); |
473 | } | 473 | } |