Refactor event creation and display: Remove debug logs from event creation page, enhance layout for better responsiveness, and implement image URL fallback logic in event detail and index pages. Improve error handling for image loading.
This commit is contained in:
parent
e4a0a9ab0f
commit
c3a29fa47c
4 changed files with 56 additions and 51 deletions
|
|
@ -317,20 +317,7 @@ const handleImageError = (event) => {
|
|||
}
|
||||
}
|
||||
|
||||
const editEvent = async (event) => {
|
||||
console.log('🔍 Edit button clicked for event:', event)
|
||||
console.log('🔍 Event ID:', event._id)
|
||||
console.log('🔍 Event ID as string:', String(event._id))
|
||||
const editUrl = `/admin/events/create?edit=${String(event._id)}`
|
||||
console.log('🔍 Generated URL:', editUrl)
|
||||
|
||||
try {
|
||||
console.log('🔍 Waiting 2 seconds before navigation...')
|
||||
await new Promise(resolve => setTimeout(resolve, 2000))
|
||||
console.log('🔍 Now navigating with window.location...')
|
||||
window.location.href = editUrl
|
||||
} catch (error) {
|
||||
console.error('❌ Navigation failed:', error)
|
||||
}
|
||||
const editEvent = (event) => {
|
||||
navigateTo(`/admin/events/create?edit=${String(event._id)}`)
|
||||
}
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue