mirror of
https://gitlab.aliens-lyon.fr/encartes/web-interface.git
synced 2026-03-17 22:51:04 +01:00
New search
This commit is contained in:
parent
ac263166fa
commit
bfccd5a0e9
@ -14,7 +14,7 @@ export default function RoomResearch({ callbackRoomSelected }) {
|
|||||||
const [rooms, setRooms] = React.useState([]);
|
const [rooms, setRooms] = React.useState([]);
|
||||||
|
|
||||||
const startResearch = (event) => {
|
const startResearch = (event) => {
|
||||||
fetch(API_URL + "find_place_by_name/" + currentRequest)
|
fetch(API_URL + "search_place?text=" + encodeURI(currentRequest))
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
setRooms(data);
|
setRooms(data);
|
||||||
|
|||||||
@ -15,18 +15,16 @@ export default function Rooms({ rooms, callbackRoomSelected }) {
|
|||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell>Salle</TableCell>
|
<TableCell>Salle</TableCell>
|
||||||
<TableCell>Bâtiment</TableCell>
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{rooms.map((room) => {
|
{rooms.map((room) => {
|
||||||
return <TableRow
|
return <TableRow
|
||||||
hover={true}
|
hover={true}
|
||||||
onClick={() => callbackRoomSelected(room.floors[0].id, room.idPlace)}
|
onClick={() => callbackRoomSelected(room.floor, room.pid)}
|
||||||
key={room.idPlace}
|
key={room.pid}
|
||||||
>
|
>
|
||||||
<TableCell>{room.namePlace[0]}</TableCell>
|
<TableCell>{room.txt}</TableCell>
|
||||||
<TableCell>{room.nameBuilding}</TableCell>
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
})}
|
})}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user