Remove self-service-overview gorgias endpoint
This commit is contained in:
@@ -28,7 +28,6 @@ import {
|
|||||||
Zap,
|
Zap,
|
||||||
Timer,
|
Timer,
|
||||||
BarChart3,
|
BarChart3,
|
||||||
Bot,
|
|
||||||
ClipboardCheck,
|
ClipboardCheck,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
@@ -214,7 +213,7 @@ const GorgiasOverview = () => {
|
|||||||
const filters = getDateRange(timeRange);
|
const filters = getDateRange(timeRange);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const [overview, channelStats, agentStats, satisfaction, selfService] =
|
const [overview, channelStats, agentStats, satisfaction] =
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
axios.post('/api/gorgias/stats/overview', filters)
|
axios.post('/api/gorgias/stats/overview', filters)
|
||||||
.then(res => res.data?.data?.data?.data || []),
|
.then(res => res.data?.data?.data?.data || []),
|
||||||
@@ -224,8 +223,6 @@ const GorgiasOverview = () => {
|
|||||||
.then(res => res.data?.data?.data?.data?.lines || []),
|
.then(res => res.data?.data?.data?.data?.lines || []),
|
||||||
axios.post('/api/gorgias/stats/satisfaction-surveys', filters)
|
axios.post('/api/gorgias/stats/satisfaction-surveys', filters)
|
||||||
.then(res => res.data?.data?.data?.data || []),
|
.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:', {
|
console.log('Raw API responses:', {
|
||||||
@@ -233,7 +230,6 @@ const GorgiasOverview = () => {
|
|||||||
channelStats,
|
channelStats,
|
||||||
agentStats,
|
agentStats,
|
||||||
satisfaction,
|
satisfaction,
|
||||||
selfService
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setData({
|
setData({
|
||||||
@@ -241,7 +237,6 @@ const GorgiasOverview = () => {
|
|||||||
channels: channelStats,
|
channels: channelStats,
|
||||||
agents: agentStats,
|
agents: agentStats,
|
||||||
satisfaction,
|
satisfaction,
|
||||||
selfService,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setError(null);
|
setError(null);
|
||||||
@@ -292,19 +287,6 @@ const GorgiasOverview = () => {
|
|||||||
|
|
||||||
console.log('Processed satisfaction stats:', satisfactionStats);
|
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
|
// Process channel data
|
||||||
const channels = data.channels?.map(line => ({
|
const channels = data.channels?.map(line => ({
|
||||||
name: line[0]?.value || '',
|
name: line[0]?.value || '',
|
||||||
@@ -377,7 +359,7 @@ const GorgiasOverview = () => {
|
|||||||
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4">
|
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4">
|
||||||
{/* Message & Response Metrics */}
|
{/* Message & Response Metrics */}
|
||||||
{loading ? (
|
{loading ? (
|
||||||
[...Array(8)].map((_, i) => (
|
[...Array(7)].map((_, i) => (
|
||||||
<SkeletonMetricCard key={i} />
|
<SkeletonMetricCard key={i} />
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
@@ -457,17 +439,6 @@ const GorgiasOverview = () => {
|
|||||||
loading={loading}
|
loading={loading}
|
||||||
/>
|
/>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user