updated actionlist, added dynamic url in environment(.production).ts

master
Max 5 years ago
parent 1375d479eb
commit 595df9ffcc

@ -1,15 +1,15 @@
export class Actionlist{ export class Actionlist{
actions: { id: number, name: string, points: number}[] = [ actions: { id: number, name: string, points: number}[] = [
{ id: 0, name: "collect much trash",points: 25}, { id: 0, name: "collect a lot of trash",points: 25},
{ id: 1, name: "collect a bit trash",points: 5 }, { id: 1, name: "collect a bit of trash",points: 10 },
{ id: 2, name: "trash seperation", points: 5 }, { id: 2, name: "do trash seperation", points: 5 },
{ id: 3, name: "plant a tree", points: 2 }, { id: 3, name: "plant a tree", points: 2 },
{ id: 4, name: "beautify yout surroundings", points: 8 }, { id: 4, name: "beautify your surroundings", points: 8 },
{ id: 5, name: "reduce waste", points: 5 }, { id: 5, name: "reduce waste", points: 5 },
{ id: 6, name: "reduce CO2 emission", points: 5 }, { id: 6, name: "reduce CO2 emission", points: 5 },
{ id: 7, name: "eat a vegetarian meal", points: 2 }, { id: 7, name: "eat a vegetarian meal", points: 2 },
{ id: 8, name: "don't use the car", points: 10 }, { id: 8, name: "don't use the car", points: 10 },
{ id: 9, name: "buy fair trade/ local product", points: 1 }, { id: 9, name: "buy a fair trade/ local product", points: 1 },
{ id: 10, name: "donate money to an environment organisation ", points: 3 }, { id: 10, name: "donate money to an environment organisation ", points: 10 },
]; ];
} }

@ -5,6 +5,7 @@ import { responsePathAsArray } from 'graphql';
import { Chatmessage } from 'src/app/models/chatmessage'; import { Chatmessage } from 'src/app/models/chatmessage';
import { FriendInfo } from 'src/app/models/friendinfo'; import { FriendInfo } from 'src/app/models/friendinfo';
import { DatasharingService } from '../datasharing.service'; import { DatasharingService } from '../datasharing.service';
import { environment } from 'src/environments/environment';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -22,7 +23,7 @@ export class ChatService {
public getAllChats(): Array<Chat> { public getAllChats(): Array<Chat> {
console.log("Getting all chats ..") console.log("Getting all chats ..")
let url = 'https://greenvironment.net/graphql' let url = environment.graphQLUrl
let headers = new Headers() let headers = new Headers()
headers.set('Content-Type', 'application/json') headers.set('Content-Type', 'application/json')

@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { Http } from '@angular/http'; import { Http } from '@angular/http';
import { Post } from 'src/app/models/post'; import { Post } from 'src/app/models/post';
import { Author } from 'src/app/models/author'; import { Author } from 'src/app/models/author';
import { environment } from 'src/environments/environment';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -13,8 +14,7 @@ export class FeedService {
constructor(private http: Http) { } constructor(private http: Http) { }
public createPost(pContent: String){ public createPost(pContent: String){
let url = 'https://greenvironment.net/graphql' let url = environment.graphQLUrl
let headers = new Headers() let headers = new Headers()
headers.set('Content-Type', 'application/json') headers.set('Content-Type', 'application/json')

@ -5,6 +5,7 @@ import { User } from 'src/app/models/user';
import { DatasharingService } from '../datasharing.service'; import { DatasharingService } from '../datasharing.service';
import { userInfo } from 'os'; import { userInfo } from 'os';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import { environment } from 'src/environments/environment';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -16,7 +17,7 @@ export class LoginService {
public login(login : Login, errorCb: any) { public login(login : Login, errorCb: any) {
//let url = './graphql' //let url = './graphql'
let url = 'https://greenvironment.net/graphql' let url = environment.graphQLUrl
let headers = new Headers(); let headers = new Headers();
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');

@ -4,6 +4,7 @@ import { Registration } from '../../models/registration';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import { DatasharingService } from '../datasharing.service'; import { DatasharingService } from '../datasharing.service';
import { User } from 'src/app/models/user'; import { User } from 'src/app/models/user';
import { environment } from 'src/environments/environment';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -15,7 +16,7 @@ export class RegisterService {
public register(registration: Registration, errorCb: any) { public register(registration: Registration, errorCb: any) {
//let url = './graphql' //let url = './graphql'
let url = 'https://greenvironment.net/graphql' let url = environment.graphQLUrl
let headers = new Headers(); let headers = new Headers();
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');

@ -5,6 +5,7 @@ import { User } from 'src/app/models/user';
import { DatasharingService } from '../datasharing.service'; import { DatasharingService } from '../datasharing.service';
import { userInfo } from 'os'; import { userInfo } from 'os';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import { environment } from 'src/environments/environment';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -15,8 +16,8 @@ export class SelfService {
public checkIfLoggedIn() { public checkIfLoggedIn() {
console.log('check if logged in...'); console.log('check if logged in...');
//let url = './graphql'
let url = 'https://greenvironment.net/graphql' let url = environment.graphQLUrl;
let headers = new Headers(); let headers = new Headers();
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
@ -38,8 +39,6 @@ export class SelfService {
public notLoggedIn(){ public notLoggedIn(){
console.log('user was not logged in'); console.log('user was not logged in');
//do routing
//this.router.navigateByUrl('/login');
} }
public updateUserInfo(response : any){ public updateUserInfo(response : any){

@ -1,3 +1,4 @@
export const environment = { export const environment = {
production: true production: true,
graphQLUrl: '/graphql'
}; };

@ -3,7 +3,8 @@
// The list of file replacements can be found in `angular.json`. // The list of file replacements can be found in `angular.json`.
export const environment = { export const environment = {
production: false production: false,
graphQLUrl: 'https://greenvironment.net/graphql'
}; };
/* /*

Loading…
Cancel
Save