update routes.ts

This commit is contained in:
joseph le 2023-09-13 15:30:35 +07:00
parent eaa86820cb
commit 527ac8ac54
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import { getListLog } from "../../api/apiLog";
import "./ListLog.css";
const ListLog = () => {
const [listFile, setListFile] = useState([]);
const [status, setStatus] = useState();
const [status, setStatus] = useState(200);
const [nameSearch, setNameSearch] = useState("");
const getListFile = async () => {
try {
@ -41,7 +41,7 @@ const ListLog = () => {
setNameSearch(e.target.value)
}}></input>
</div>
{listFile?.filter((f)=>f.search(nameSearch)!==-1).map((file) => (
{listFile?.filter((f)=>f.toLocaleLowerCase().search(nameSearch.toLocaleLowerCase())!==-1).map((file) => (
<div>
<Link to={"/logs/" + file}>{file}</Link>
<br></br>

View File

@ -6,7 +6,7 @@ import "./ShowLog.css";
const ShowLog = () => {
let { name } = useParams();
const [log, setLog] = useState({});
const [status, setStatus] = useState();
const [status, setStatus] = useState(200);
const getContentLog = async () => {
try {
const res = await axios.get(getLog + "/" + name);
@ -131,7 +131,7 @@ const ShowLog = () => {
return (
<div>
<h1>
<i>The file was not found or no errors were found in the file.</i>
<i>The file was not found.</i>
</h1>
</div>
);