File manager - Edit - /var/www/payraty/helpdesk/common/resources/client/notifications/dialog/requests/user-notifications.ts
Back
import {useQuery} from '@tanstack/react-query'; import {PaginatedBackendResponse} from '@common/http/backend-response/pagination-response'; import {DatabaseNotification} from '@common/notifications/database-notification'; import {apiClient} from '@common/http/query-client'; const Endpoint = 'notifications'; export interface FetchUserNotificationsResponse extends PaginatedBackendResponse<DatabaseNotification> { // } interface Payload { perPage?: number; } export function useUserNotifications(payload?: Payload) { return useQuery({ queryKey: useUserNotifications.key, queryFn: () => fetchUserNotifications(payload), }); } function fetchUserNotifications( payload?: Payload, ): Promise<FetchUserNotificationsResponse> { return apiClient .get(Endpoint, {params: payload}) .then(response => response.data); } useUserNotifications.key = [Endpoint];
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings