File tree Expand file tree Collapse file tree 3 files changed +3
-9
lines changed
Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,10 @@ class AnalysisService extends HttpFactory {
3636
3737 async getAllAnalyses ( ) {
3838 const analyses = await this . getCall < Analysis [ ] > ( this . RESOURCE ) ;
39- const analysesWithCO2Converted = analyses . map ( ( analysis ) => ( {
39+ return analyses . map ( ( analysis ) => ( {
4040 ...analysis ,
4141 co2Converted : convertEstimateToBestMassUnit ( analysis . co2Gr ) ,
4242 } ) ) ;
43-
44- return analysesWithCO2Converted ;
4543 }
4644
4745 async getAnalysisById ( analysisId : string ) {
Original file line number Diff line number Diff line change @@ -43,10 +43,7 @@ class AWSDataCenterService extends HttpFactory {
4343 const infrastructure =
4444 await this . infrastructureService . getInfrastructure ( infrastructureId ) ;
4545 const regions = await this . getAllAWSDataCenter ( ) ;
46- const currentRegion = regions . find (
47- ( region ) => region . id === infrastructure . defaultRegion ,
48- ) ;
49- return currentRegion ;
46+ return regions . find ( ( region ) => region . id === infrastructure . defaultRegion ) ;
5047 }
5148}
5249
Original file line number Diff line number Diff line change @@ -22,11 +22,10 @@ class ScanService extends HttpFactory {
2222 private readonly RESOURCE = "/api/scanner" ;
2323 async getAllScans ( ) : Promise < Scan [ ] > {
2424 const scans = await this . getCall < Scan [ ] > ( this . RESOURCE ) ;
25- const scansWithCO2Converted = scans . map ( ( scan ) => ( {
25+ return scans . map ( ( scan ) => ( {
2626 ...scan ,
2727 co2Converted : convertEstimateToBestMassUnit ( scan . co2Gr ) ,
2828 } ) ) ;
29- return scansWithCO2Converted ;
3029 }
3130
3231 async getScanById ( scanId : string ) : Promise < EstimatedScan > {
You can’t perform that action at this time.
0 commit comments