From a530fe2e5f0238ed7558edabf8609b6f597c366c Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 29 Oct 2019 21:15:48 +0100 Subject: [PATCH] updated url --- .../components/app-scaffold/app-scaffold.component.ts | 3 ++- src/app/components/profile/profile.component.ts | 3 ++- src/app/components/social/friends/friends.component.ts | 3 ++- src/app/services/chat/chat.service.ts | 10 +++++----- src/app/services/feed/feed.service.ts | 10 +++++----- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/app/components/app-scaffold/app-scaffold.component.ts b/src/app/components/app-scaffold/app-scaffold.component.ts index b7b0384..e16399e 100644 --- a/src/app/components/app-scaffold/app-scaffold.component.ts +++ b/src/app/components/app-scaffold/app-scaffold.component.ts @@ -6,6 +6,7 @@ import { Levellist } from 'src/app/models/levellist'; import { Http } from '@angular/http'; import { Router } from '@angular/router'; import { User } from 'src/app/models/user'; +import { environment } from 'src/environments/environment'; @Component({ selector: 'app-scaffold', @@ -49,7 +50,7 @@ export class AppScaffoldComponent implements OnInit { } logout() { - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers() headers.set('Content-Type', 'application/json') diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index 9c04ba0..2b252e6 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -4,6 +4,7 @@ import {Http, URLSearchParams, Headers} from '@angular/http'; import { User } from 'src/app/models/user'; import { Actionlist } from 'src/app/models/actionlist'; import { Levellist } from 'src/app/models/levellist'; +import { environment } from 'src/environments/environment'; @Component({ selector: 'app-profile', @@ -23,7 +24,7 @@ export class ProfileComponent implements OnInit { ngOnInit() { this.id = this.router.url.substr(this.router.url.lastIndexOf("/") + 1); //let url = './graphql' - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers(); headers.set('Content-Type', 'application/json'); diff --git a/src/app/components/social/friends/friends.component.ts b/src/app/components/social/friends/friends.component.ts index 4c4bc27..533b00c 100644 --- a/src/app/components/social/friends/friends.component.ts +++ b/src/app/components/social/friends/friends.component.ts @@ -3,6 +3,7 @@ import { DatasharingService } from 'src/app/services/datasharing.service'; import { Http } from '@angular/http'; import { FriendInfo } from 'src/app/models/friendinfo'; import { Router } from '@angular/router'; +import { environment } from 'src/environments/environment'; @Component({ selector: 'social-friends', @@ -24,7 +25,7 @@ export class FriendsComponent implements OnInit { getFriendsNames() { for(let id of this.friendIDs) { - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers(); headers.set('Content-Type', 'application/json'); diff --git a/src/app/services/chat/chat.service.ts b/src/app/services/chat/chat.service.ts index f054989..3ccbfb2 100644 --- a/src/app/services/chat/chat.service.ts +++ b/src/app/services/chat/chat.service.ts @@ -40,7 +40,7 @@ export class ChatService { console.log("Getting chats by ID..") for(let chatId of pChatIDs) { - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers() headers.set('Content-Type', 'application/json') @@ -54,7 +54,7 @@ export class ChatService { } public createNewChat(pUserID: number) { - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers() headers.set('Content-Type', 'application/json') @@ -63,7 +63,7 @@ export class ChatService { } public requestAllChatPartners(): Array { - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let chatPartners: Array let temp @@ -91,7 +91,7 @@ export class ChatService { } public sendMessage(pChatID: number, pContent: string) { - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers() headers.set('Content-Type', 'application/json') @@ -101,7 +101,7 @@ export class ChatService { public getMessages(pChatID): Array { let messages: Array - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers() headers.set('Content-Type', 'application/json') diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index 235f8a4..c621975 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -29,7 +29,7 @@ export class FeedService { } public createPost2(pContent: String){ - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers() headers.set('Content-Type', 'application/json') @@ -43,7 +43,7 @@ export class FeedService { } public upvote(pPostID: number): void { - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers() headers.set('Content-Type', 'application/json') @@ -59,7 +59,7 @@ export class FeedService { } public downvote(pPostID: number): void { - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers() headers.set('Content-Type', 'application/json') @@ -75,7 +75,7 @@ export class FeedService { } public getAllPosts(): Array { - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers() headers.set('Content-Type', 'application/json') @@ -89,7 +89,7 @@ export class FeedService { } public getAllPostsRaw(): any { - let url = 'https://greenvironment.net/graphql' + let url = environment.graphQLUrl let headers = new Headers() headers.set('Content-Type', 'application/json')