Skip to content

Commit eb068ea

Browse files
author
gondzo
committed
change api service config variables
1 parent f6b112a commit eb068ea

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/services/APIService.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import _ from 'lodash';
44
import superagent from 'superagent';
55
import superagentPromise from 'superagent-promise';
6-
import config from '../../config/default';
6+
import config from '../config/index';
77

88
// DEMO: emulate API requests with dummy data for demo purposes
99

@@ -467,13 +467,13 @@ const testUser = {
467467
};
468468

469469
const register = () => request
470-
.post(`${config.API_BASE_PATH}/api/v1/register`)
470+
.post(`${config.api.basePath}/api/v1/register`)
471471
.send(testUser)
472472
.set('Content-Type', 'application/json')
473473
.end();
474474

475475
const authorize = () => request
476-
.post(`${config.API_BASE_PATH}/api/v1/login`)
476+
.post(`${config.api.basePath}/api/v1/login`)
477477
.set('Content-Type', 'application/json')
478478
.send(_.pick(testUser, 'email', 'password'))
479479
.end();
@@ -505,12 +505,12 @@ export default class APIService {
505505
const accessToken = authRes.body.accessToken;
506506

507507
return request
508-
.get(`${config.API_BASE_PATH}/api/v1/missions`)
508+
.get(`${config.api.basePath}/api/v1/missions`)
509509
.set('Authorization', `Bearer ${accessToken}`)
510510
.end()
511511
.then((res) => res.body.items.map((item) => ({
512512
...item,
513-
downloadLink: `${config.API_BASE_PATH}/api/v1/missions/${item.id}/download?token=${accessToken}`,
513+
downloadLink: `${config.api.basePath}/api/v1/missions/${item.id}/download?token=${accessToken}`,
514514
})));
515515
});
516516
}
@@ -520,7 +520,7 @@ export default class APIService {
520520
const accessToken = authRes.body.accessToken;
521521

522522
return request
523-
.get(`${config.API_BASE_PATH}/api/v1/missions/${id}`)
523+
.get(`${config.api.basePath}/api/v1/missions/${id}`)
524524
.set('Authorization', `Bearer ${accessToken}`)
525525
.end()
526526
.then((res) => res.body);
@@ -532,7 +532,7 @@ export default class APIService {
532532
const accessToken = authRes.body.accessToken;
533533

534534
return request
535-
.post(`${config.API_BASE_PATH}/api/v1/missions`)
535+
.post(`${config.api.basePath}/api/v1/missions`)
536536
.set('Authorization', `Bearer ${accessToken}`)
537537
.send(values)
538538
.end()
@@ -545,7 +545,7 @@ export default class APIService {
545545
const accessToken = authRes.body.accessToken;
546546

547547
return request
548-
.put(`${config.API_BASE_PATH}/api/v1/missions/${id}`)
548+
.put(`${config.api.basePath}/api/v1/missions/${id}`)
549549
.set('Authorization', `Bearer ${accessToken}`)
550550
.send(values)
551551
.end()
@@ -558,7 +558,7 @@ export default class APIService {
558558
const accessToken = authRes.body.accessToken;
559559

560560
return request
561-
.del(`${config.API_BASE_PATH}/api/v1/missions/${id}`)
561+
.del(`${config.api.basePath}/api/v1/missions/${id}`)
562562
.set('Authorization', `Bearer ${accessToken}`)
563563
.end()
564564
.then((res) => res.body);
@@ -574,7 +574,7 @@ export default class APIService {
574574
*/
575575
static searchDrones(params) {
576576
return request
577-
.get(`${config.API_BASE_PATH}/api/v1/drones`)
577+
.get(`${config.api.basePath}/api/v1/drones`)
578578
.query(params)
579579
.end();
580580
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy