Remove self-service-overview gorgias endpoint

This commit is contained in:
2025-02-02 21:21:51 -05:00
parent c45ae24647
commit 06aa2372e4

View File

@@ -28,7 +28,6 @@ import {
Zap,
Timer,
BarChart3,
Bot,
ClipboardCheck,
} from "lucide-react";
import axios from "axios";
@@ -214,7 +213,7 @@ const GorgiasOverview = () => {
const filters = getDateRange(timeRange);
try {
const [overview, channelStats, agentStats, satisfaction, selfService] =
const [overview, channelStats, agentStats, satisfaction] =
await Promise.all([
axios.post('/api/gorgias/stats/overview', filters)
.then(res => res.data?.data?.data?.data || []),
@@ -224,8 +223,6 @@ const GorgiasOverview = () => {
.then(res => res.data?.data?.data?.data?.lines || []),
axios.post('/api/gorgias/stats/satisfaction-surveys', filters)
.then(res => res.data?.data?.data?.data || []),
axios.post('/api/gorgias/stats/self-service-overview', filters)
.then(res => res.data?.data?.data?.data || []),
]);
console.log('Raw API responses:', {
@@ -233,7 +230,6 @@ const GorgiasOverview = () => {
channelStats,
agentStats,
satisfaction,
selfService
});
setData({
@@ -241,7 +237,6 @@ const GorgiasOverview = () => {
channels: channelStats,
agents: agentStats,
satisfaction,
selfService,
});
setError(null);
@@ -292,19 +287,6 @@ const GorgiasOverview = () => {
console.log('Processed satisfaction stats:', satisfactionStats);
// Process self-service data
const selfServiceStats = (data.selfService || []).reduce((acc, item) => {
acc[item.name] = {
value: item.value || 0,
delta: item.delta || 0,
type: item.type,
more_is_better: item.more_is_better
};
return acc;
}, {});
console.log('Processed self-service stats:', selfServiceStats);
// Process channel data
const channels = data.channels?.map(line => ({
name: line[0]?.value || '',
@@ -377,7 +359,7 @@ const GorgiasOverview = () => {
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4">
{/* Message & Response Metrics */}
{loading ? (
[...Array(8)].map((_, i) => (
[...Array(7)].map((_, i) => (
<SkeletonMetricCard key={i} />
))
) : (
@@ -457,17 +439,6 @@ const GorgiasOverview = () => {
loading={loading}
/>
</div>
<div className="h-full">
<MetricCard
title="Self-Service Rate"
value={selfServiceStats.self_service_automation_rate?.value}
delta={selfServiceStats.self_service_automation_rate?.delta}
suffix="%"
icon={Bot}
colorClass="cyan"
loading={loading}
/>
</div>
</>
)}
</div>