Skip to content

Commit d39d480

Browse files
committed
import and used environment class in user provider and http requests
1 parent 189e744 commit d39d480

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/providers/user/user.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { HttpClient } from '@angular/common/http';
22
import { Injectable } from '@angular/core';
33

4+
import { ENV } from '@app /env';
5+
46
/*
57
Generated class for the UserProvider provider.
68
@@ -10,19 +12,19 @@ import { Injectable } from '@angular/core';
1012
@Injectable()
1113
export class UserProvider {
1214

13-
regUrl: string = "https://j-reboot-backend.herokuapp.com/api/appUsers"
15+
requestUrl: string = ENV.url
1416

1517
constructor(public http: HttpClient) {
1618
console.log('Hello UserProvider Provider');
1719
}
1820

1921
sendReg(user) {
2022
console.log('sendReg() runs')
21-
return this.http.post(this.regUrl, user)
23+
return this.http.post(this.requestUrl, user)
2224
}
2325

2426

2527
login(creds) {
26-
return this.http.post('https://reboot-ssf.herokuapp.com/api/appUsers/login', creds);
28+
return this.http.post(this.requestUrl + '/login', creds);
2729
}
2830
}

0 commit comments

Comments
 (0)