mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-31 04:38:08 +00:00
Refactor: Update customer context usage in DNS history page
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/11971ec2-3615-47ae-8f09-4df9209737a3.jpg
This commit is contained in:
@@ -2,7 +2,7 @@ import { useState, useEffect } from "react";
|
|||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { MainLayout } from "@/components/layouts/main-layout";
|
import { MainLayout } from "@/components/layouts/main-layout";
|
||||||
import { DnsHistory, Domain } from "@shared/schema";
|
import { DnsHistory, Domain } from "@shared/schema";
|
||||||
import { useOrganization } from "@/context/organization-context";
|
import { useCustomer } from "@/context/customer-context";
|
||||||
import { formatDistanceToNow, format } from "date-fns";
|
import { formatDistanceToNow, format } from "date-fns";
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
@@ -31,15 +31,15 @@ import { Badge } from "@/components/ui/badge";
|
|||||||
import { Loader2, Plus, Pencil, Trash, AlertCircle } from "lucide-react";
|
import { Loader2, Plus, Pencil, Trash, AlertCircle } from "lucide-react";
|
||||||
|
|
||||||
export default function HistoryPage() {
|
export default function HistoryPage() {
|
||||||
const { currentOrganization } = useOrganization();
|
const { currentCustomer } = useCustomer();
|
||||||
const [selectedDomain, setSelectedDomain] = useState<string>("all");
|
const [selectedDomain, setSelectedDomain] = useState<string>("all");
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
const pageSize = 10;
|
const pageSize = 10;
|
||||||
|
|
||||||
// Fetch domains for filter
|
// Fetch domains for filter
|
||||||
const { data: domains = [] } = useQuery<Domain[]>({
|
const { data: domains = [] } = useQuery<Domain[]>({
|
||||||
queryKey: ["/api/domains", currentOrganization?.id],
|
queryKey: ["/api/domains", currentCustomer?.id],
|
||||||
enabled: !!currentOrganization?.id,
|
enabled: !!currentCustomer?.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fetch DNS history
|
// Fetch DNS history
|
||||||
|
|||||||
Reference in New Issue
Block a user