diff --git a/backend/src/controller/person/mod.rs b/backend/src/controller/person/mod.rs index e5a96d7..f857f06 100644 --- a/backend/src/controller/person/mod.rs +++ b/backend/src/controller/person/mod.rs @@ -1,5 +1,3 @@ -use std::fmt::format; - use reqwest::Client; use rocket::http::Status; use rocket::serde::json::Json; diff --git a/frontend/src/certs/Search/index.tsx b/frontend/src/certs/Search/index.tsx index 666e421..c187df4 100644 --- a/frontend/src/certs/Search/index.tsx +++ b/frontend/src/certs/Search/index.tsx @@ -6,8 +6,9 @@ import { XIcon } from "../../icons/XIcon"; import { Person } from "../../types/Person"; import { PersonDisplay } from "./PersonDisplay"; import { PersonRegister } from "./PersonRegister"; -import { backend } from "../../utils/functions"; +import { backend, wait } from "../../utils/functions"; import { JsonResult } from "../../types/JsonResult"; +import { LoadingIcon } from "../../icons/LoadingIcon"; type HTMLButtonEvent = JSX.EventHandlerUnion; @@ -46,10 +47,12 @@ export function Search(props: {setPerson: (p: Person | null) => void}) { /* Get the user data from the DB */ - const search = () => { + const search = async() => { setLoading(true); setError(""); + await wait(1500); + backend.get>(`/api/person/${dni()}`) .then((response) => { if (response.status === 200) { @@ -155,6 +158,13 @@ function InputBox(props: { + + + +