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 { Label } from "~/components/ui/label";
|
||||||
import { getStudentMatch, mergeStudent } from "~/lib/api";
|
import { getStudentMatch, mergeStudent } from "~/lib/api";
|
||||||
|
|
||||||
type Student = {
|
type PartialStudent = {
|
||||||
id: string;
|
id: string;
|
||||||
fistName: string;
|
fullName: string;
|
||||||
lastName: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export function MatchStudent({
|
export function MatchStudent({
|
||||||
|
|
@ -16,7 +15,7 @@ export function MatchStudent({
|
||||||
}: {
|
}: {
|
||||||
firstName: string;
|
firstName: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
onSuccess: (student: Student) => void;
|
onSuccess: (student: PartialStudent) => void;
|
||||||
}) {
|
}) {
|
||||||
const [pastClasses, setPastClasses] = useState<
|
const [pastClasses, setPastClasses] = useState<
|
||||||
{ value: string; label: string }[]
|
{ value: string; label: string }[]
|
||||||
|
|
@ -31,7 +30,7 @@ export function MatchStudent({
|
||||||
|
|
||||||
const [pastClassName, setPastClassName] = useState("");
|
const [pastClassName, setPastClassName] = useState("");
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [matchedStudent, setMatchedStudent] = useState<Student | null>(null);
|
const [matchedStudent, setMatchedStudent] = useState<PartialStudent | null>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (pastClassName) {
|
if (pastClassName) {
|
||||||
|
|
@ -73,8 +72,7 @@ export function MatchStudent({
|
||||||
{matchedStudent && (
|
{matchedStudent && (
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<p>
|
<p>
|
||||||
Correspondance trouvée: {matchedStudent.fistName}{" "}
|
Correspondance trouvée: {matchedStudent.fullName}
|
||||||
{matchedStudent.lastName}
|
|
||||||
</p>
|
</p>
|
||||||
<button onClick={handleValidate}>Valider</button>
|
<button onClick={handleValidate}>Valider</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue