error-handling-added

parent 7fe4671d
......@@ -2,12 +2,7 @@ import React from "react";
import moment from "moment";
function AccordionTable({ headers, data }) {
const getDate = (utc) => {
// const utcDate = new Date(utc);
// const localTime = utcDate.toLocaleString();
// const someday = moment(utc);
return moment(utc).format('DD-MM-YYYY');
}
return (
......
......@@ -52,7 +52,7 @@ function Reports() {
}
useEffect(() => {
if(id) {
if(id!==undefined|| null) {
const emp = reportees?.filter((item) => item.empId === Number(id));
setEmpDetails(emp[0]);
const data = {
......@@ -67,8 +67,6 @@ function Reports() {
})
},[id]);
useEffect(()=>{},[reports])
return (
<div className="p-4">
<div className="flex bg-white p-3">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment