feat(notification): base notifcaiton sub and admin compelted
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m59s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m59s
can now sub to a notification and user can remove them selfs plus an admin can remove,updates to add new emails are good as well
This commit is contained in:
@@ -14,7 +14,7 @@ import { notifications } from "../../../lib/queries/notifications";
|
||||
|
||||
export default function NotificationsSubCard({ user }: any) {
|
||||
const { data } = useSuspenseQuery(notifications());
|
||||
const { data: ns, refetch } = useSuspenseQuery(notificationSubs(user.id));
|
||||
const { refetch } = useSuspenseQuery(notificationSubs(user.id));
|
||||
const form = useAppForm({
|
||||
defaultValues: {
|
||||
notificationId: "",
|
||||
@@ -32,8 +32,11 @@ export default function NotificationsSubCard({ user }: any) {
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
refetch();
|
||||
form.reset();
|
||||
if (res.status === 200) {
|
||||
toast.success("Notification Subbed");
|
||||
refetch();
|
||||
form.reset();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { createColumnHelper } from "@tanstack/react-table";
|
||||
import axios from "axios";
|
||||
import { Trash } from "lucide-react";
|
||||
import { toast } from "sonner";
|
||||
import type { Notifications } from "../../../../types/notifications";
|
||||
import { Button } from "../../../components/ui/button";
|
||||
import { Card, CardContent, CardHeader } from "../../../components/ui/card";
|
||||
import {
|
||||
@@ -15,14 +16,6 @@ import { notifications } from "../../../lib/queries/notifications";
|
||||
import LstTable from "../../../lib/tableStuff/LstTable";
|
||||
import SearchableHeader from "../../../lib/tableStuff/SearchableHeader";
|
||||
|
||||
type Notifications = {
|
||||
id: string;
|
||||
name: string;
|
||||
emails: string;
|
||||
description: string;
|
||||
remove: unknown;
|
||||
};
|
||||
|
||||
export default function NotificationsTable({ userId }: any) {
|
||||
const { data: subs, refetch } = useSuspenseQuery(notificationSubs(userId));
|
||||
const { data: note } = useSuspenseQuery(notifications());
|
||||
@@ -101,6 +94,7 @@ export default function NotificationsTable({ userId }: any) {
|
||||
return (
|
||||
<Button
|
||||
size="icon"
|
||||
variant={"destructive"}
|
||||
onClick={() => removeNotification(i.row.original)}
|
||||
>
|
||||
<Trash />
|
||||
|
||||
Reference in New Issue
Block a user