complated project
This commit is contained in:
14
screens/e-services/lib/api.ts
Normal file
14
screens/e-services/lib/api.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import httpClient from '@/api/httpClient';
|
||||
import { API_URLS } from '@/api/URLs';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { GovermentServiceData } from './types';
|
||||
|
||||
export const eservices_api = {
|
||||
async list(params: {
|
||||
page: number;
|
||||
page_size: number;
|
||||
}): Promise<AxiosResponse<GovermentServiceData>> {
|
||||
const res = await httpClient.get(API_URLS.Goverment_Service, { params });
|
||||
return res;
|
||||
},
|
||||
};
|
||||
21
screens/e-services/lib/types.ts
Normal file
21
screens/e-services/lib/types.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
export interface GovermentServiceData {
|
||||
status: boolean;
|
||||
data: {
|
||||
links: {
|
||||
previous: null | string;
|
||||
next: null | string;
|
||||
};
|
||||
total_items: number;
|
||||
total_pages: number;
|
||||
page_size: number;
|
||||
current_page: number;
|
||||
results: GovermentServiceDataRes[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface GovermentServiceDataRes {
|
||||
id: number;
|
||||
name: string;
|
||||
url: string;
|
||||
logo: string;
|
||||
}
|
||||
Reference in New Issue
Block a user