| 12345678910111213141516171819202122232425262728293031323334 |
- import ApiRequestService from "./apiRequestService";
- class dataProvider {
- private apiRequestService: ApiRequestService;
- public constructor(apiRequestService: ApiRequestService) {
- this.apiRequestService = apiRequestService;
- }
- public async fetchNews(): Promise<{ news }> {
- const response = await this.apiRequestService.get(
- "/news"
- );
- console.log(response)
- return {
- news: response,
- };
-
- }
- public async fetchNew(
- id: number
- ): Promise<{ new }> {
- const response = await this.apiRequestService.get(
- "/news/" + id
- );
- console.log(response)
- return {
- new: response,
- };
- }
- }
- export default dataProvider;
|