@@ -23,49 +23,49 @@ export class EntryService {
2323 urlInProductionLegacy = environment . production === EnvironmentType . TT_PROD_LEGACY ;
2424
2525 loadActiveEntry ( ) : Observable < any > {
26- return this . http . get ( `${ this . baseUrl } /running` ) ;
26+ return this . http . get ( `${ this . baseUrl } /running` , { withCredentials : true } ) ;
2727 }
2828
2929 loadEntries ( date ) : Observable < any > {
3030 const timezoneOffset = new Date ( ) . getTimezoneOffset ( ) ;
31- return this . http . get ( `${ this . baseUrl } ?month=${ date . month } &year=${ date . year } &timezone_offset=${ timezoneOffset } ` ) ;
31+ return this . http . get ( `${ this . baseUrl } ?month=${ date . month } &year=${ date . year } &timezone_offset=${ timezoneOffset } ` , { withCredentials : true } ) ;
3232 }
3333
3434 createEntry ( entryData ) : Observable < any > {
35- return this . http . post ( this . baseUrl , entryData ) ;
35+ return this . http . post ( this . baseUrl , entryData , { withCredentials : true } ) ;
3636 }
3737
3838 updateEntry ( entryData ) : Observable < any > {
3939 const { id} = entryData ;
40- return this . http . put ( `${ this . baseUrl } /${ id } ` , entryData ) ;
40+ return this . http . put ( `${ this . baseUrl } /${ id } ` , entryData , { withCredentials : true } ) ;
4141 }
4242
4343 deleteEntry ( entryId : string ) : Observable < any > {
4444 const url = `${ this . baseUrl } /${ entryId } ` ;
45- return this . http . delete ( url ) ;
45+ return this . http . delete ( url , { withCredentials : true } ) ;
4646 }
4747
4848 stopEntryRunning ( idEntry : string ) : Observable < any > {
4949 return ( this . urlInProductionLegacy ?
50- this . http . post ( `${ this . baseUrl } /${ idEntry } /stop` , null ) : this . http . put ( `${ this . baseUrl } /stop` , null ) ) ;
50+ this . http . post ( `${ this . baseUrl } /${ idEntry } /stop` , null , { withCredentials : true } ) : this . http . put ( `${ this . baseUrl } /stop` , null , { withCredentials : true } ) ) ;
5151 }
5252
5353 restartEntry ( idEntry : string ) : Observable < Entry > {
5454 const url = `${ this . baseUrl } /${ idEntry } /restart` ;
55- return this . http . post < Entry > ( url , null ) ;
55+ return this . http . post < Entry > ( url , null , { withCredentials : true } ) ;
5656 }
5757
5858 summary ( ) : Observable < TimeEntriesSummary > {
5959 const timeOffset = new Date ( ) . getTimezoneOffset ( ) ;
6060 const summaryUrl = `${ this . baseUrl } /summary?time_offset=${ timeOffset } ` ;
61- return this . http . get < TimeEntriesSummary > ( summaryUrl ) ;
61+ return this . http . get < TimeEntriesSummary > ( summaryUrl , { withCredentials : true } ) ;
6262 }
6363
6464 findEntriesByProjectId ( projectId : string ) : Observable < Entry [ ] > {
6565 const startDate = this . getDateLastMonth ( ) ;
6666 const endDate = this . getCurrentDate ( ) ;
6767 const findEntriesByProjectURL = `${ this . baseUrl } ?limit=2&project_id=${ projectId } &start_date=${ startDate } &end_date=${ endDate } ` ;
68- return this . http . get < Entry [ ] > ( findEntriesByProjectURL ) ;
68+ return this . http . get < Entry [ ] > ( findEntriesByProjectURL , { withCredentials : true } ) ;
6969 }
7070
7171 loadEntriesByTimeRange ( range : TimeEntriesTimeRange , userId : string ) : Observable < any > {
@@ -79,7 +79,8 @@ export class EntryService {
7979 user_id : userId ,
8080 limit : `${ MAX_NUMBER_OF_ENTRIES_FOR_REPORTS } ` ,
8181 timezone_offset : new Date ( ) . getTimezoneOffset ( ) . toString ( ) ,
82- }
82+ } ,
83+ withCredentials : true
8384 }
8485 ) ;
8586 }
0 commit comments