remove error log
This commit is contained in:
parent
c048e05746
commit
1dbab67618
@ -96,9 +96,7 @@ export function PromptCard({ prompt, onViewIncrement }: PromptCardProps) {
|
||||
userId: user.id,
|
||||
tags: prompt.tags.map(tag => tag.name),
|
||||
}
|
||||
|
||||
console.log('Duplicating prompt with data:', requestData)
|
||||
|
||||
|
||||
const response = await fetch('/api/prompts', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@ -124,14 +122,11 @@ export function PromptCard({ prompt, onViewIncrement }: PromptCardProps) {
|
||||
}, 2000)
|
||||
} else {
|
||||
// Create error notification
|
||||
console.error('API response error:', response.status, response.statusText)
|
||||
let errorMessage = 'Failed to duplicate prompt'
|
||||
try {
|
||||
const errorData = await response.json()
|
||||
console.error('Error data:', errorData)
|
||||
errorMessage = errorData.error || `HTTP ${response.status}: ${response.statusText}`
|
||||
} catch (e) {
|
||||
console.error('Failed to parse error response:', e)
|
||||
errorMessage = `HTTP ${response.status}: ${response.statusText}`
|
||||
}
|
||||
|
||||
@ -150,7 +145,6 @@ export function PromptCard({ prompt, onViewIncrement }: PromptCardProps) {
|
||||
}, 3000)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to duplicate:', error)
|
||||
// Create error notification for network/other errors
|
||||
const notification = document.createElement('div')
|
||||
notification.className = 'fixed top-4 right-4 bg-red-500 text-white px-4 py-2 rounded-md shadow-lg z-50 transition-all duration-300'
|
||||
|
@ -124,14 +124,11 @@ export function PromptDetailModal({
|
||||
}, 2000)
|
||||
} else {
|
||||
// Create error notification
|
||||
console.error('API response error:', response.status, response.statusText)
|
||||
let errorMessage = 'Failed to duplicate prompt'
|
||||
try {
|
||||
const errorData = await response.json()
|
||||
console.error('Error data:', errorData)
|
||||
errorMessage = errorData.error || `HTTP ${response.status}: ${response.statusText}`
|
||||
} catch (e) {
|
||||
console.error('Failed to parse error response:', e)
|
||||
errorMessage = `HTTP ${response.status}: ${response.statusText}`
|
||||
}
|
||||
|
||||
@ -150,7 +147,6 @@ export function PromptDetailModal({
|
||||
}, 3000)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to duplicate:', error)
|
||||
// Create error notification for network/other errors
|
||||
const notification = document.createElement('div')
|
||||
notification.className = 'fixed top-4 right-4 bg-red-500 text-white px-4 py-2 rounded-md shadow-lg z-50 transition-all duration-300'
|
||||
|
Loading…
Reference in New Issue
Block a user