mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-07-26 11:38:13 +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 { MainLayout } from "@/components/layouts/main-layout";
|
||||
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 {
|
||||
Card,
|
||||
@@ -31,15 +31,15 @@ import { Badge } from "@/components/ui/badge";
|
||||
import { Loader2, Plus, Pencil, Trash, AlertCircle } from "lucide-react";
|
||||
|
||||
export default function HistoryPage() {
|
||||
const { currentOrganization } = useOrganization();
|
||||
const { currentCustomer } = useCustomer();
|
||||
const [selectedDomain, setSelectedDomain] = useState<string>("all");
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const pageSize = 10;
|
||||
|
||||
// Fetch domains for filter
|
||||
const { data: domains = [] } = useQuery<Domain[]>({
|
||||
queryKey: ["/api/domains", currentOrganization?.id],
|
||||
enabled: !!currentOrganization?.id,
|
||||
queryKey: ["/api/domains", currentCustomer?.id],
|
||||
enabled: !!currentCustomer?.id,
|
||||
});
|
||||
|
||||
// Fetch DNS history
|
||||
|
||||
Reference in New Issue
Block a user