fix: remove duplicate endpoints.ts, fix Login imports
Build and Deploy / build (push) Failing after 10s
Build and Deploy / docker (push) Has been skipped
Build and Deploy / deploy (push) Has been skipped

- Remove web/src/api/endpoints.ts (redundant with index.ts)
- Fix Login.tsx to use useLogin hook
- Simplify Dockerfile (use CI-built artifacts)
This commit is contained in:
2026-07-20 20:00:41 +00:00
parent 6ffa2ecdfb
commit c3e834a2b4
3 changed files with 10 additions and 97 deletions
+7 -10
View File
@@ -1,27 +1,24 @@
import { useState } from 'react'
import { useNavigate } from '@tanstack/react-router'
import { login } from '@/api/endpoints'
import { useLogin } from '@/api/hooks'
import { Lock, User, AlertCircle } from 'lucide-react'
export default function Login() {
const navigate = useNavigate()
const loginMutation = useLogin()
const [username, setUsername] = useState('')
const [password, setPassword] = useState('')
const [error, setError] = useState('')
const [loading, setLoading] = useState(false)
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
setError('')
setLoading(true)
try {
await login(username, password)
await loginMutation.mutateAsync({ username, password })
navigate({ to: '/' })
} catch (err: any) {
setError(err.message || 'Login failed')
} finally {
setLoading(false)
}
}
@@ -130,7 +127,7 @@ export default function Login() {
<button
type="submit"
disabled={loading}
disabled={loginMutation.isPending}
style={{
width: '100%',
padding: 12,
@@ -140,11 +137,11 @@ export default function Login() {
color: 'white',
fontSize: 14,
fontWeight: 500,
cursor: loading ? 'not-allowed' : 'pointer',
opacity: loading ? 0.7 : 1,
cursor: loginMutation.isPending ? 'not-allowed' : 'pointer',
opacity: loginMutation.isPending ? 0.7 : 1,
}}
>
{loading ? 'Signing in...' : 'Sign In'}
{loginMutation.isPending ? 'Signing in...' : 'Sign In'}
</button>
</form>
</div>