Type Error Fix getNotifications

This commit is contained in:
headlessdev 2025-04-17 15:39:21 +02:00
parent 6fd360b594
commit 155a0af883

View File

@ -49,6 +49,10 @@ import {
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { Checkbox } from "@/components/ui/checkbox"; import { Checkbox } from "@/components/ui/checkbox";
interface NotificationsResponse {
notifications: any[];
}
export default function Settings() { export default function Settings() {
const { theme, setTheme } = useTheme(); const { theme, setTheme } = useTheme();
@ -196,9 +200,8 @@ export default function Settings() {
const getNotifications = async () => { const getNotifications = async () => {
try { try {
const response = await axios.post('/api/notifications/get', {}); const response = await axios.post<NotificationsResponse>('/api/notifications/get', {});
if (response.status === 200 && response.data) { if (response.status === 200 && response.data) {
console.log(response.data.notifications)
setNotifications(response.data.notifications); setNotifications(response.data.notifications);
} }
} }