修正評審評分清單失敗問題
This commit is contained in:
@@ -198,11 +198,8 @@ export function AppDetailDialog({ open, onOpenChange, app }: AppDetailDialogProp
|
||||
if (department) params.append('department', department)
|
||||
|
||||
const url = `/api/apps/${app.id}/stats${params.toString() ? `?${params.toString()}` : ''}`
|
||||
console.log('🔍 調用統計 API:', url)
|
||||
console.log('🔍 應用 ID:', app.id)
|
||||
|
||||
const response = await fetch(url)
|
||||
console.log('🔍 API 響應狀態:', response.status, response.statusText)
|
||||
|
||||
if (!response.ok) {
|
||||
console.error('❌ API 響應錯誤:', response.status, response.statusText)
|
||||
@@ -210,10 +207,8 @@ export function AppDetailDialog({ open, onOpenChange, app }: AppDetailDialogProp
|
||||
}
|
||||
|
||||
const data = await response.json()
|
||||
console.log('🔍 API 響應數據:', data)
|
||||
|
||||
if (data.success) {
|
||||
console.log('📊 應用統計數據加載成功:', data.data)
|
||||
setAppStats(data.data)
|
||||
setCurrentRating(data.data.basic.rating)
|
||||
setReviewCount(data.data.basic.reviewCount)
|
||||
@@ -272,14 +267,12 @@ export function AppDetailDialog({ open, onOpenChange, app }: AppDetailDialogProp
|
||||
}, [startDate, endDate, open, app.id, handleDateRangeChange])
|
||||
|
||||
const handleTryApp = async () => {
|
||||
console.log('handleTryApp 被調用', { user: user?.id, appId: app.id })
|
||||
|
||||
if (user) {
|
||||
addToRecentApps(app.id.toString())
|
||||
|
||||
// 記錄用戶活動
|
||||
try {
|
||||
console.log('開始記錄用戶活動...')
|
||||
const response = await fetch('/api/user/activity', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -298,7 +291,6 @@ export function AppDetailDialog({ open, onOpenChange, app }: AppDetailDialogProp
|
||||
})
|
||||
|
||||
if (response.ok) {
|
||||
console.log('活動記錄成功')
|
||||
} else {
|
||||
console.error('活動記錄失敗:', response.status, response.statusText)
|
||||
}
|
||||
@@ -306,7 +298,6 @@ export function AppDetailDialog({ open, onOpenChange, app }: AppDetailDialogProp
|
||||
console.error('記錄活動失敗:', error)
|
||||
}
|
||||
} else {
|
||||
console.log('用戶未登入,跳過活動記錄')
|
||||
}
|
||||
|
||||
// Increment view count when trying the app
|
||||
|
Reference in New Issue
Block a user