fix: show display name
All checks were successful
Deploy to Netlify / Deploy to Netlify (push) Successful in 1m20s
All checks were successful
Deploy to Netlify / Deploy to Netlify (push) Successful in 1m20s
This commit is contained in:
parent
38833a7fce
commit
49affe118b
1 changed files with 5 additions and 7 deletions
|
|
@ -3,10 +3,9 @@ import { Combobox } from "~/components/combobox";
|
|||
import { Label } from "~/components/ui/label";
|
||||
import { getStudentMatch, mergeStudent } from "~/lib/api";
|
||||
|
||||
type Student = {
|
||||
type PartialStudent = {
|
||||
id: string;
|
||||
fistName: string;
|
||||
lastName: string;
|
||||
fullName: string;
|
||||
};
|
||||
|
||||
export function MatchStudent({
|
||||
|
|
@ -16,7 +15,7 @@ export function MatchStudent({
|
|||
}: {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
onSuccess: (student: Student) => void;
|
||||
onSuccess: (student: PartialStudent) => void;
|
||||
}) {
|
||||
const [pastClasses, setPastClasses] = useState<
|
||||
{ value: string; label: string }[]
|
||||
|
|
@ -31,7 +30,7 @@ export function MatchStudent({
|
|||
|
||||
const [pastClassName, setPastClassName] = useState("");
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [matchedStudent, setMatchedStudent] = useState<Student | null>(null);
|
||||
const [matchedStudent, setMatchedStudent] = useState<PartialStudent | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (pastClassName) {
|
||||
|
|
@ -73,8 +72,7 @@ export function MatchStudent({
|
|||
{matchedStudent && (
|
||||
<div className="flex items-center justify-between">
|
||||
<p>
|
||||
Correspondance trouvée: {matchedStudent.fistName}{" "}
|
||||
{matchedStudent.lastName}
|
||||
Correspondance trouvée: {matchedStudent.fullName}
|
||||
</p>
|
||||
<button onClick={handleValidate}>Valider</button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue