-
+
diff --git a/static/src/app/army/army-member.component.ts b/static/src/app/army/army-member.component.ts
index c8fb143..4a3a70a 100644
--- a/static/src/app/army/army-member.component.ts
+++ b/static/src/app/army/army-member.component.ts
@@ -3,6 +3,7 @@ import {User} from "../models/model-interfaces";
import {ActivatedRoute, Router} from "@angular/router";
import {UserService} from "../services/user-service/user.service";
import {Subscription} from "rxjs/Subscription";
+import {AppConfig, RouteConfig} from "../app.config";
@Component({
@@ -38,7 +39,7 @@ export class ArmyMemberComponent {
};
backToOverview() {
- this.router.navigate(['cc-overview']);
+ this.router.navigate([RouteConfig.overviewPath]);
}
}
diff --git a/static/src/app/login/login.component.ts b/static/src/app/login/login.component.ts
index 17e11c2..3510135 100644
--- a/static/src/app/login/login.component.ts
+++ b/static/src/app/login/login.component.ts
@@ -1,6 +1,7 @@
import {Component, OnInit} from "@angular/core";
import {Router} from "@angular/router";
import {LoginService} from "../services/login-service/login-service";
+import {RouteConfig} from "../app.config";
@Component({
@@ -27,7 +28,7 @@ export class LoginComponent implements OnInit {
// reset login status
this.loginService.logout();
// redirect on success
- this.returnUrl = '/cc-overview'
+ this.returnUrl = RouteConfig.overviewPath;
}
login(username: string, password: string) {
diff --git a/static/src/app/login/signup.component.ts b/static/src/app/login/signup.component.ts
index 1d151f5..22e9531 100644
--- a/static/src/app/login/signup.component.ts
+++ b/static/src/app/login/signup.component.ts
@@ -1,6 +1,7 @@
import {Component, OnInit} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router";
import {LoginService} from "../services/login-service/login-service";
+import {RouteConfig} from "../app.config";
@Component({
@@ -30,7 +31,7 @@ export class SignupComponent implements OnInit {
// reset login status
this.loginService.logout();
// redirect on success
- this.returnUrl = '/cc-overview'
+ this.returnUrl = RouteConfig.overviewPath;
}
login(username: string, password: string, secret: string) {
diff --git a/static/src/app/services/app-user-service/app-user.service.ts b/static/src/app/services/app-user-service/app-user.service.ts
index c28e165..e657d73 100644
--- a/static/src/app/services/app-user-service/app-user.service.ts
+++ b/static/src/app/services/app-user-service/app-user.service.ts
@@ -19,7 +19,7 @@ export class AppUserService {
}
getUsers() {
- this.http.get(this.config.apiUrl + this.config.apiAppUserPath)
+ this.http.get(this.config.apiAppUserPath)
.map(res => res.json())
.do((users) => {
this.appUserStore.dispatch({type: LOAD, data: users});
@@ -30,7 +30,7 @@ export class AppUserService {
}
updateUser(user: AppUser) {
- return this.http.patch(this.config.apiUrl + this.config.apiAppUserPath + user._id, user)
+ return this.http.patch(this.config.apiAppUserPath + user._id, user)
.map(res => res.json())
.do(savedUser => {
const action = {type: EDIT, data: savedUser};
@@ -39,7 +39,7 @@ export class AppUserService {
}
deleteUser(user) {
- return this.http.delete(this.config.apiUrl + this.config.apiAppUserPath + user._id)
+ return this.http.delete(this.config.apiAppUserPath + user._id)
.do(res => {
this.appUserStore.dispatch({type: REMOVE, data: user});
});
diff --git a/static/src/app/services/army-service/army.service.ts b/static/src/app/services/army-service/army.service.ts
index e940021..e31c023 100644
--- a/static/src/app/services/army-service/army.service.ts
+++ b/static/src/app/services/army-service/army.service.ts
@@ -11,7 +11,7 @@ export class ArmyService {
}
getArmy() {
- return this.http.get(this.config.apiUrl + this.config.apiOverviewPath)
+ return this.http.get(this.config.apiOverviewPath)
.map(res => res.json());
}
diff --git a/static/src/app/services/awarding-service/awarding.service.ts b/static/src/app/services/awarding-service/awarding.service.ts
index 0c81b4e..f0e43f4 100644
--- a/static/src/app/services/awarding-service/awarding.service.ts
+++ b/static/src/app/services/awarding-service/awarding.service.ts
@@ -13,7 +13,7 @@ export class AwardingService {
}
getUnconfirmedAwards(fraction?: string) {
- return this.http.get(this.config.apiUrl + this.config.apiAwardPath + '?inProgress=true&fractFilter=' + fraction)
+ return this.http.get(this.config.apiAwardPath + '?inProgress=true&fractFilter=' + fraction)
.map(res => res.json())
}
@@ -29,25 +29,25 @@ export class AwardingService {
* get awards array with populated decorations
*/
getUserAwardings(userId: string) {
- return this.http.get(this.config.apiUrl + this.config.apiAwardPath + '?userId=' + userId)
+ return this.http.get(this.config.apiAwardPath + '?userId=' + userId)
.map(res => res.json())
}
addAwarding(award: Award) {
- return this.http.post(this.config.apiUrl + this.config.apiAwardPath, award)
+ return this.http.post(this.config.apiAwardPath, award)
}
updateAward(award) {
- return this.http.patch(this.config.apiUrl + this.config.apiAwardPath + '/' + award._id, award)
+ return this.http.patch(this.config.apiAwardPath + '/' + award._id, award)
.map(res => res.json())
}
requestAwarding(award: Award) {
- return this.http.post(this.config.apiUrl + this.config.apiRequestAwardPath, award)
+ return this.http.post(this.config.apiRequestAwardPath, award)
}
deleteAwarding(awardingId) {
- return this.http.delete(this.config.apiUrl + this.config.apiAwardPath + '/' + awardingId)
+ return this.http.delete(this.config.apiAwardPath + '/' + awardingId)
}
}
diff --git a/static/src/app/services/decoration-service/decoration.service.ts b/static/src/app/services/decoration-service/decoration.service.ts
index 33f1774..3ae388c 100644
--- a/static/src/app/services/decoration-service/decoration.service.ts
+++ b/static/src/app/services/decoration-service/decoration.service.ts
@@ -26,7 +26,7 @@ export class DecorationService {
searchParams.append('fractFilter', fractionFilter);
}
- this.http.get(this.config.apiUrl + this.config.apiDecorationPath, searchParams)
+ this.http.get(this.config.apiDecorationPath, searchParams)
.map(res => res.json())
.do((squads) => {
this.decorationStore.dispatch({type: LOAD, data: squads});
@@ -37,7 +37,7 @@ export class DecorationService {
}
getDecoration(id: number | string): Observable {
- return this.http.get(this.config.apiUrl + this.config.apiDecorationPath + id)
+ return this.http.get(this.config.apiDecorationPath + id)
.map(res => res.json());
}
@@ -46,7 +46,7 @@ export class DecorationService {
* update existing with patch PATCH
*/
submitDecoration(decoration: Decoration, imageFile?) {
- let requestUrl = this.config.apiUrl + this.config.apiDecorationPath;
+ let requestUrl = this.config.apiDecorationPath;
let requestMethod: RequestMethod;
let accessType;
let body;
@@ -88,7 +88,7 @@ export class DecorationService {
deleteDecoration(decoration: Decoration) {
- return this.http.delete(this.config.apiUrl + this.config.apiDecorationPath + decoration._id)
+ return this.http.delete(this.config.apiDecorationPath + decoration._id)
.do(res => {
this.decorationStore.dispatch({type: REMOVE, data: decoration});
});
diff --git a/static/src/app/services/login-service/login-service.ts b/static/src/app/services/login-service/login-service.ts
index 6828bdc..f337a74 100644
--- a/static/src/app/services/login-service/login-service.ts
+++ b/static/src/app/services/login-service/login-service.ts
@@ -18,7 +18,7 @@ export class LoginService {
}
login(username: string, password: string) {
- return this.http.post(this.config.apiUrl + this.config.apiAuthenticationPath, {username: username, password: password})
+ return this.http.post(this.config.apiAuthenticationPath, {username: username, password: password})
.map((response: Response) => {
// login successful if there's a jwt token in the response
let user = response.json();
@@ -35,7 +35,7 @@ export class LoginService {
}
signUp(username: string, password: string, secret: string) {
- return this.http.post(this.config.apiUrl + this.config.apiSignupPath, {username: username, password: password, secret: secret})
+ return this.http.post(this.config.apiSignupPath, {username: username, password: password, secret: secret})
.map((response: Response) => {
});
diff --git a/static/src/app/services/promotion-service/promotion.service.ts b/static/src/app/services/promotion-service/promotion.service.ts
index 8433728..52fea32 100644
--- a/static/src/app/services/promotion-service/promotion.service.ts
+++ b/static/src/app/services/promotion-service/promotion.service.ts
@@ -13,7 +13,7 @@ export class PromotionService {
}
getUnconfirmedPromotions(fraction?: string) {
- return this.http.get(this.config.apiUrl + this.config.apiPromotionPath + '?inProgress=true&fractFilter=' + fraction)
+ return this.http.get(this.config.apiPromotionPath + '?inProgress=true&fractFilter=' + fraction)
.map(res => res.json())
}
@@ -26,21 +26,21 @@ export class PromotionService {
}
getSquadPromotions(squadId: string) {
- return this.http.get(this.config.apiUrl + this.config.apiPromotionPath + '?squadId=' + squadId)
+ return this.http.get(this.config.apiPromotionPath + '?squadId=' + squadId)
.map(res => res.json())
}
requestPromotion(promotion: Promotion) {
- return this.http.post(this.config.apiUrl + this.config.apiPromotionPath, promotion)
+ return this.http.post(this.config.apiPromotionPath, promotion)
}
updatePromotion(promotion) {
- return this.http.patch(this.config.apiUrl + this.config.apiPromotionPath + '/' + promotion._id, promotion)
+ return this.http.patch(this.config.apiPromotionPath + '/' + promotion._id, promotion)
.map(res => res.json())
}
deletePromotion(promotionId) {
- return this.http.delete(this.config.apiUrl + this.config.apiPromotionPath + promotionId)
+ return this.http.delete(this.config.apiPromotionPath + promotionId)
}
}
diff --git a/static/src/app/services/rank-service/rank.service.ts b/static/src/app/services/rank-service/rank.service.ts
index 335a5bc..2c201e8 100644
--- a/static/src/app/services/rank-service/rank.service.ts
+++ b/static/src/app/services/rank-service/rank.service.ts
@@ -27,7 +27,7 @@ export class RankService {
searchParams.append('fractFilter', fractionFilter);
}
- this.http.get(this.config.apiUrl + this.config.apiRankPath, searchParams)
+ this.http.get(this.config.apiRankPath, searchParams)
.map(res => res.json())
.do((ranks) => {
this.rankStore.dispatch({type: LOAD, data: ranks});
@@ -38,7 +38,7 @@ export class RankService {
}
getRank(id: number | string): Observable {
- return this.http.get(this.config.apiUrl + this.config.apiRankPath + id)
+ return this.http.get(this.config.apiRankPath + id)
.map(res => res.json());
}
@@ -47,7 +47,7 @@ export class RankService {
* update existing with patch PATCH
*/
submitRank(rank: Rank, imageFile?) {
- let requestUrl = this.config.apiUrl + this.config.apiRankPath;
+ let requestUrl = this.config.apiRankPath;
let requestMethod: RequestMethod;
let accessType;
let body;
@@ -102,7 +102,7 @@ export class RankService {
method: RequestMethod.Patch
});
- return this.http.request(this.config.apiUrl + this.config.apiRankPath + rank._id, options)
+ return this.http.request(this.config.apiRankPath + rank._id, options)
.map(res => res.json())
.do(savedRank => {
const action = {type: EDIT, data: savedRank};
@@ -124,7 +124,7 @@ export class RankService {
// provide token as query value, because there is no actual body
// and x-access-token is ignored in multipart request
- return this.http.patch(this.config.apiUrl + this.config.apiRankPath + rankId, formData)
+ return this.http.patch(this.config.apiRankPath + rankId, formData)
.map(res => res.json())
.do(savedDecoration => {
const action = {type: EDIT, data: savedDecoration};
@@ -133,7 +133,7 @@ export class RankService {
}
deleteRank(rank: Rank) {
- return this.http.delete(this.config.apiUrl + this.config.apiRankPath + rank._id)
+ return this.http.delete(this.config.apiRankPath + rank._id)
.do(res => {
this.rankStore.dispatch({type: REMOVE, data: rank});
});
diff --git a/static/src/app/services/squad-service/squad.service.ts b/static/src/app/services/squad-service/squad.service.ts
index 195ffe2..c07ce93 100644
--- a/static/src/app/services/squad-service/squad.service.ts
+++ b/static/src/app/services/squad-service/squad.service.ts
@@ -23,7 +23,7 @@ export class SquadService {
searchParams.append('q', query);
searchParams.append('fractFilter', fractionFilter);
- this.http.get(this.config.apiUrl + this.config.apiSquadPath, searchParams)
+ this.http.get(this.config.apiSquadPath, searchParams)
.map(res => res.json())
.do((squads) => {
this.squadStore.dispatch({type: LOAD, data: squads});
@@ -35,7 +35,7 @@ export class SquadService {
getSquad(id: number | string): Observable {
- return this.http.get(this.config.apiUrl + this.config.apiSquadPath + id)
+ return this.http.get(this.config.apiSquadPath + id)
.map(res => res.json());
}
@@ -45,7 +45,7 @@ export class SquadService {
* update existing with patch PATCH
*/
submitSquad(squad: Squad, imageFile?) {
- let requestUrl = this.config.apiUrl + this.config.apiSquadPath;
+ let requestUrl = this.config.apiSquadPath;
let requestMethod: RequestMethod;
let accessType;
let body;
@@ -85,7 +85,7 @@ export class SquadService {
}
deleteSquad(squad: Squad) {
- return this.http.delete(this.config.apiUrl + this.config.apiSquadPath + squad._id)
+ return this.http.delete(this.config.apiSquadPath + squad._id)
.do(res => {
this.squadStore.dispatch({type: REMOVE, data: squad});
});
diff --git a/static/src/app/services/user-service/user.service.ts b/static/src/app/services/user-service/user.service.ts
index d36e9ce..b378d5d 100644
--- a/static/src/app/services/user-service/user.service.ts
+++ b/static/src/app/services/user-service/user.service.ts
@@ -26,7 +26,7 @@ export class UserService {
if (squadFilter) {
searchParams.append('squadId', squadFilter);
}
- this.http.get(this.config.apiUrl + this.config.apiUserPath, searchParams)
+ this.http.get(this.config.apiUserPath, searchParams)
.map(res => res.json())
.do((users) => {
this.userStore.dispatch({type: LOAD, data: users});
@@ -37,12 +37,12 @@ export class UserService {
}
getUser(_id: number | string): Observable {
- return this.http.get(this.config.apiUrl + this.config.apiUserPath + _id)
+ return this.http.get(this.config.apiUserPath + _id)
.map(res => res.json());
}
submitUser(user) {
- return this.http.post(this.config.apiUrl + this.config.apiUserPath, user)
+ return this.http.post(this.config.apiUserPath, user)
.map(res => res.json())
.do(savedUser => {
const action = {type: ADD, data: savedUser};
@@ -51,7 +51,7 @@ export class UserService {
}
updateUser(user) {
- return this.http.put(this.config.apiUrl + this.config.apiUserPath + user._id, user)
+ return this.http.put(this.config.apiUserPath + user._id, user)
.map(res => res.json())
.do(savedUser => {
const action = {type: EDIT, data: savedUser};
@@ -60,7 +60,7 @@ export class UserService {
}
deleteUser(user) {
- return this.http.delete(this.config.apiUrl + this.config.apiUserPath + user._id)
+ return this.http.delete(this.config.apiUserPath + user._id)
.do(res => {
this.userStore.dispatch({type: REMOVE, data: user});
});
diff --git a/static/src/app/services/war-service/war.service.ts b/static/src/app/services/war-service/war.service.ts
index cb5e574..ac6de1a 100644
--- a/static/src/app/services/war-service/war.service.ts
+++ b/static/src/app/services/war-service/war.service.ts
@@ -11,12 +11,12 @@ export class WarService {
}
getAllWars() {
- return this.http.get(this.config.apiUrl + this.config.apiWarPath)
+ return this.http.get(this.config.apiWarPath)
.map(res => res.json())
}
getWar(warId: string) {
- return this.http.get(this.config.apiUrl + this.config.apiWarPath + '/' + warId)
+ return this.http.get(this.config.apiWarPath + '/' + warId)
.map(res => res.json())
}
@@ -34,12 +34,12 @@ export class WarService {
body.append('log', logFile, logFile.name);
}
- return this.http.post(this.config.apiUrl + this.config.apiWarPath, body)
+ return this.http.post(this.config.apiWarPath, body)
.map(res => res.json())
}
deleteWar(id: string) {
- return this.http.delete(this.config.apiUrl + this.config.apiWarPath + '/' + id)
+ return this.http.delete(this.config.apiWarPath + '/' + id)
.map(res => res.json())
}