@@ -17,19 +17,19 @@ export class ProjectService {
1717
1818 getProjects ( customerId : any ) : Observable < Project [ ] > {
1919 const params = new HttpParams ( ) . set ( 'customer_id' , customerId . customerId ) ;
20- return this . http . get < Project [ ] > ( this . url , { params } ) ;
20+ return this . http . get < Project [ ] > ( this . url , { params, withCredentials : true } ) ;
2121 }
2222
2323 getAllProjects ( ) : Observable < Project [ ] > {
24- return this . http . get < Project [ ] > ( this . url ) ;
24+ return this . http . get < Project [ ] > ( this . url , { withCredentials : true } ) ;
2525 }
2626
2727 getRecentProjects ( ) : Observable < Project [ ] > {
28- return this . http . get < Project [ ] > ( `${ this . url } /recent` ) ;
28+ return this . http . get < Project [ ] > ( `${ this . url } /recent` , { withCredentials : true } ) ;
2929 }
3030
3131 createProject ( projectData ) : Observable < any > {
32- return this . http . post < Project [ ] > ( this . url , projectData ) ;
32+ return this . http . post < Project [ ] > ( this . url , projectData , { withCredentials : true } ) ;
3333 }
3434
3535 updateProject ( projectData ) : Observable < any > {
@@ -39,12 +39,12 @@ export class ProjectService {
3939 projectData . status = 1 ;
4040 }
4141 }
42- return this . http . put ( `${ this . url } /${ id } ` , projectData ) ;
42+ return this . http . put ( `${ this . url } /${ id } ` , projectData , { withCredentials : true } ) ;
4343 }
4444
4545 deleteProject ( projectId : string ) : Observable < any > {
4646 return this . isDevelopmentOrProd
4747 ? this . http . put ( `${ this . url } /${ projectId } ` , { status : 0 } )
48- : this . http . delete ( `${ this . url } /${ projectId } ` ) ;
48+ : this . http . delete ( `${ this . url } /${ projectId } ` , { withCredentials : true } ) ;
4949 }
5050}
0 commit comments