fix: resolve frontend lint issues
All checks were successful
Tests / Backend - Tests passed: 8
THE-TIP-TOP-MULTIBRANCH/pipeline/head This commit looks good

This commit is contained in:
2026-08-17 14:54:58 +00:00
parent 0f1ad0b2ef
commit 047d34f59b
6 changed files with 85 additions and 96 deletions

View File

@@ -56,7 +56,7 @@ export default function Admin() {
if (!handleAuthError(e)) setError(e.message)
})
.finally(() => setLoading(false))
}, [])
}, [handleAuthError])
const handleDraw = async () => {
setShowConfirm(false)
@@ -94,7 +94,7 @@ export default function Admin() {
const csv = [header, ...rows]
.map((row) => row.map((cell) => `"${String(cell).replace(/"/g, '""')}"`).join(';'))
.join('\n')
const blob = new Blob([`${csv}`], { type: 'text/csv;charset=utf-8;' })
const blob = new Blob(['\uFEFF' + csv], { type: 'text/csv;charset=utf-8;' })
const url = URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url

View File

@@ -50,7 +50,20 @@ export default function MesGains() {
}
}, [handleAuthError])
useEffect(() => { fetchGains() }, [fetchGains])
useEffect(() => {
const loadGains = async () => {
try {
const data = await myGainsApi()
setGains(data.gains)
} catch (err) {
if (!handleAuthError(err)) setError(err.message)
} finally {
setLoading(false)
}
}
loadGains()
}, [handleAuthError])
return (
<div className="min-h-screen bg-gray-50 flex flex-col px-8 py-12 max-w-lg mx-auto">

View File

@@ -1,20 +1,12 @@
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import UserNav from '../components/UserNav'
import { changePasswordApi, deleteAccountApi } from '../services/auth'
import { changePasswordApi} from '../services/auth'
import { useHandleAuthError } from '../hooks/useHandleAuthError'
import { useAuth } from '../context/AuthContext'
export default function Profile() {
const user = JSON.parse(localStorage.getItem('user') || '{}')
const initials = `${(user.firstname || '?')[0]}${(user.lastname || '?')[0]}`.toUpperCase()
const handleAuthError = useHandleAuthError()
const { logout } = useAuth()
const navigate = useNavigate()
const [showDeleteModal, setShowDeleteModal] = useState(false)
const [deleting, setDeleting] = useState(false)
const [deleteError, setDeleteError] = useState('')
const [pwForm, setPwForm] = useState({ currentPassword: '', newPassword: '', confirmPassword: '' })
const [showPw, setShowPw] = useState({ current: false, new: false, confirm: false })

View File

@@ -17,7 +17,6 @@ export default function SaisirCodeUnique() {
const [code, setCode] = useState('')
const [loading, setLoading] = useState(false)
const [gain, setGain] = useState(null)
const [claim, setClaim] = useState(null)
const [wonAt, setWonAt] = useState(null)
const [showDetail, setShowDetail] = useState(false)
@@ -27,7 +26,6 @@ export default function SaisirCodeUnique() {
try {
const data = await participateApi(code.trim().toUpperCase())
setGain(data.gain)
setClaim(data.claim)
setWonAt(new Date())
} catch (err) {
if (!handleAuthError(err)) {
@@ -40,7 +38,6 @@ export default function SaisirCodeUnique() {
const handleClose = () => {
setGain(null)
setClaim(null)
setWonAt(null)
setShowDetail(false)
setCode('')