Skip to content
Snippets Groups Projects
Verified Commit 4b41c261 authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Change api function name.

parent f47b1e90
No related branches found
No related tags found
2 merge requests!69Possibility to insert a reservation and new docs.,!67Insert a reservation and search by senior.
......@@ -2,7 +2,7 @@
import React, { FC, useEffect, useState } from 'react';
import TextField from '@material-ui/core/TextField';
import Autocomplete from '@material-ui/lab/Autocomplete';
import { getSeniorList } from 'api/getSeniorList';
import { getSeniorListByLastName } from 'api/getSeniorListByLastName';
import { SeniorSearchQueryType } from 'types/SeniorSearchQueryType';
import { getSeniorListByCard } from 'api/getSeniorListByCard';
......@@ -23,7 +23,7 @@ export const SeniorSearch: FC<SeniorSearchProps> = ({
const cardNumber = Number(query);
if (Number.isNaN(cardNumber)) {
if (query.length >= MIN_SEARCH_LENGTH && senior == null) {
getSeniorList(query).then((list) => {
getSeniorListByLastName(query).then((list) => {
setSeniors([...seniors, ...list]);
});
}
......
......@@ -38,6 +38,7 @@ export const ReservationDialog: FC<ReservationDialogProps> = ({
getRoleObject().then((role) => {
filledReservation.insertedBy = role.id;
filledReservation.senior = senior?.id;
console.log(filledReservation);
setReservation(filledReservation);
});
handleClose();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment