Add environment

master
Max 5 years ago
parent 6588bc6535
commit a80bcf9d3e

@ -6,6 +6,7 @@ import { RequestService } from 'src/app/services/request/request.service';
import { DatasharingService } from '../../services/datasharing.service'; import { DatasharingService } from '../../services/datasharing.service';
import { ProfileService } from 'src/app/services/profile/profile.service'; import { ProfileService } from 'src/app/services/profile/profile.service';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { environment } from 'src/environments/environment';
@Component({ @Component({
selector: 'app-profile', selector: 'app-profile',
@ -72,9 +73,9 @@ export class ProfileComponent implements OnInit {
const formData: any = new FormData(); const formData: any = new FormData();
formData.append('profilePicture', event.target.files[0]); formData.append('profilePicture', event.target.files[0]);
this.http.post('https://greenvironment.net/upload', formData).subscribe( this.http.post(environment.greenvironmentUrl, formData).subscribe(
(response: any) => { (response: any) => {
this.userProfile.profilePicture = 'https://greenvironment.net/' + response.filename; this.userProfile.profilePicture = environment.greenvironmentUrl + response.filename;
}, },
(error) => console.log(error) (error) => console.log(error)
); );

@ -82,7 +82,7 @@ export class ProfileService {
profile.friendCount = response.data.getUser.friendCount; profile.friendCount = response.data.getUser.friendCount;
profile.groupCount = response.data.getUser.groupCount; profile.groupCount = response.data.getUser.groupCount;
if (response.data.getUser.profilePicture) { if (response.data.getUser.profilePicture) {
profile.profilePicture = 'https://greenvironment.net/' + response.data.getUser.profilePicture; profile.profilePicture = environment.greenvironmentUrl + response.data.getUser.profilePicture;
} else { } else {
profile.profilePicture = 'assets/images/account_circle-24px.svg'; profile.profilePicture = 'assets/images/account_circle-24px.svg';
} }

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

@ -4,7 +4,8 @@
export const environment = { export const environment = {
production: false, production: false,
graphQLUrl: 'https://greenvironment.net/graphql' graphQLUrl: 'https://greenvironment.net/graphql',
greenvironmentUrl: 'https://greenvironment.net/',
}; };
/* /*

Loading…
Cancel
Save