-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
115 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 28 additions & 5 deletions
33
backend-external/src/v1/services/pay-transparency-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,39 @@ | ||
import { AxiosRequestConfig } from 'axios'; | ||
import { utils } from '../../utils'; | ||
import { config } from '../../config'; | ||
import { Request } from 'express'; | ||
|
||
export const payTransparencyService = { | ||
async getPayTransparencyData(startDate: string, endDate: string, offset: number, limit: number) { | ||
async getPayTransparencyData( | ||
startDate: string, | ||
endDate: string, | ||
offset: number, | ||
limit: number, | ||
) { | ||
const axiosConfig = { | ||
params: { | ||
startDate, | ||
endDate, | ||
offset, | ||
limit | ||
} | ||
limit, | ||
}, | ||
}; | ||
const { status, data } = await utils.backendAxios().get('/external-consumer-api/v1/', axiosConfig); | ||
const { status, data } = await utils | ||
.backendAxios() | ||
.get('/external-consumer-api/v1/', axiosConfig); | ||
return { status, data }; | ||
} | ||
}, | ||
async deleteReports(req: Request) { | ||
const axiosConfig: AxiosRequestConfig = { | ||
params: req.params, | ||
headers: { | ||
'x-api-key': config.get('backend:deleteReportsApiKey'), | ||
}, | ||
}; | ||
const { status, data } = await utils.backendAxios().delete<{ | ||
error: boolean; | ||
message: string; | ||
}>('/external-consumer-api/v1/delete-reports', axiosConfig); | ||
return { status, data }; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters