basse notification
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import * as api from "../service/NotificationService";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
export const useGetNotifications = () => {
|
||||
return useQuery({
|
||||
queryKey: ["notifications"],
|
||||
queryFn: api.getNotifications,
|
||||
});
|
||||
};
|
||||
@@ -5,12 +5,16 @@ import { ArrowLeft, Trash } from 'iconsax-react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useGetNotifications } from './hooks/useNotificationData';
|
||||
|
||||
type Props = object
|
||||
|
||||
export default function NotificationsIndex({ }: Props) {
|
||||
|
||||
|
||||
const { t } = useTranslation('notifications')
|
||||
const router = useRouter();
|
||||
const { data } = useGetNotifications();
|
||||
|
||||
return (
|
||||
<div className='h-full bg-inherit relative flex flex-col lg:gap-4'>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { api } from "@/config/axios";
|
||||
|
||||
export const getNotifications = async () => {
|
||||
const { data } = await api.get("/public/notifications");
|
||||
return data;
|
||||
};
|
||||
Reference in New Issue
Block a user