Refactor: Rename organization to customer in UI and API

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/630233e7-b3be-49b8-90c6-c1cf4dee6325.jpg
This commit is contained in:
alphaeusmote
2025-04-12 00:53:39 +00:00
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -5,7 +5,7 @@ import { DnsUpdateChart } from "@/components/charts/dns-update-chart";
import { ProviderDistributionChart } from "@/components/charts/provider-distribution-chart";
import { RecordTypeChart } from "@/components/charts/record-type-chart";
import { Domain, DnsMetric } from "@shared/schema";
import { useOrganization } from "@/context/organization-context";
import { useCustomer } from "@/context/customer-context";
import {
Card,
CardContent,
@@ -29,14 +29,14 @@ import {
import { BarChart, LineChart, PieChart, Home, BarChart2, Activity, Clock } from "lucide-react";
export default function MetricsPage() {
const { currentOrganization } = useOrganization();
const { currentCustomer } = useCustomer();
const [selectedTimeframe, setSelectedTimeframe] = useState("day");
const [selectedDomain, setSelectedDomain] = useState<string>("all");
// 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,
});
// Calculate date range for metrics queries
+3 -3
View File
@@ -1,9 +1,9 @@
import { useState } from "react";
import { useQuery, useMutation } from "@tanstack/react-query";
import { MainLayout } from "@/components/layouts/main-layout";
import { Organization, InsertOrganization } from "@shared/schema";
import { Customer, InsertCustomer } from "@shared/schema";
import { useAuth } from "@/hooks/use-auth";
import { useOrganization } from "@/context/organization-context";
import { useCustomer } from "@/context/customer-context";
import { apiRequest, queryClient } from "@/lib/queryClient";
import { useToast } from "@/hooks/use-toast";
import { useTheme } from "@/hooks/use-theme";
@@ -88,7 +88,7 @@ export default function SettingsPage() {
const { toast } = useToast();
const { user } = useAuth();
const { theme, setTheme } = useTheme();
const { currentOrganization, setCurrentOrganization, createOrganizationMutation } = useOrganization();
const { currentCustomer, setCurrentCustomer, createCustomerMutation } = useCustomer();
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);