File tree Expand file tree Collapse file tree 7 files changed +19
-188
lines changed Expand file tree Collapse file tree 7 files changed +19
-188
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,16 @@ import { environment } from 'src/environments/environment';
1010export class AuthService {
1111 private baseUrl : string ;
1212 constructor ( private _http : HttpClient , private _store : AuthStore ) {
13- this . baseUrl = environment . API_URL ;
13+ this . baseUrl = environment . apiUrl ;
1414 }
1515
1616 login ( { email = '' , password = '' } : LoginPayload ) {
1717 this . _store . setLoading ( true ) ;
1818 this . _http
19- . get < JUser > ( `${ this . baseUrl } /auth.json` )
19+ . post < JUser > ( `${ this . baseUrl } /auth` , {
20+ email,
21+ password
22+ } )
2023 . pipe (
2124 map ( ( user ) => {
2225 this . _store . update ( ( state ) => ( {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export class ProjectService {
1616 baseUrl : string ;
1717
1818 constructor ( private _http : HttpClient , private _store : ProjectStore ) {
19- this . baseUrl = environment . API_URL ;
19+ this . baseUrl = environment . apiUrl ;
2020 }
2121
2222 setLoading ( isLoading : boolean ) {
@@ -26,7 +26,7 @@ export class ProjectService {
2626 getProject ( ) : Subscription {
2727 this . setLoading ( true ) ;
2828 return this . _http
29- . get < JProject > ( `${ this . baseUrl } /project.json ` )
29+ . get < JProject > ( `${ this . baseUrl } /project` )
3030 . pipe (
3131 map ( ( project ) => {
3232 this . _store . update ( ( state ) => {
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ export interface EnvironmentModel {
2+ production : boolean ;
3+ apiUrl : string ;
4+ }
Original file line number Diff line number Diff line change 1- export const environment = {
1+ import { EnvironmentModel } from './environment-model' ;
2+
3+ export const environment : EnvironmentModel = {
24 production : true ,
3- API_URL : '/data '
5+ apiUrl : 'https://jira-clone-angular-api.herokuapp.com '
46} ;
Original file line number Diff line number Diff line change 22// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
33// The list of file replacements can be found in `angular.json`.
44
5- export const environment = {
5+ import { EnvironmentModel } from './environment-model' ;
6+
7+ export const environment : EnvironmentModel = {
68 production : false ,
7- API_URL : '/data '
9+ apiUrl : 'http://localhost:3000 '
810} ;
911
1012/*
You can’t perform that action at this time.
0 commit comments