chore: heygermany customer project
Some checks failed
Main / Setup and Test (push) Has been cancelled
Main / Build Website (push) Has been cancelled

This commit is contained in:
e2e
2026-07-11 11:30:11 +02:00
commit f0093328d8
370 changed files with 35601 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { signInWithPassword } from "@/lib/auth"
import { useMutation } from "@tanstack/react-query"
import { useNavigate, useParams } from "@tanstack/react-router"
export const useCompanyLogin = () => {
const navigate = useNavigate()
const { lang } = useParams({ strict: false }) as { lang?: string }
return useMutation({
mutationFn: async ({ email, password }: { email: string; password: string }) => {
return await signInWithPassword(email, password)
},
onSuccess: () => {
navigate({ to: `/${lang || 'en'}/company/candidates`, replace: true })
},
onError: (error) => {
console.error('Company login failed:', error)
}
})
}

View File

@@ -0,0 +1,10 @@
import { pikku } from "@/pikku/http"
import { useQuery } from "@tanstack/react-query"
export const useGetCompanyCandidate = (candidateId: string) => {
return useQuery({
queryKey: ['company', 'candidate', candidateId],
queryFn: async () => await pikku().get('/company/candidate/:candidateId', { candidateId }),
enabled: !!candidateId
})
}

View File

@@ -0,0 +1,9 @@
import { pikku } from "@/pikku/http"
import { useQuery } from "@tanstack/react-query"
export const useGetCompanyCandidates = () => {
return useQuery({
queryKey: ['company', 'candidates'],
queryFn: async () => await pikku().get('/company/candidate', {})
})
}