more
This commit is contained in:
@@ -27,6 +27,7 @@ const DocumentListPage = ({ perPage }) => {
|
||||
const [showDeleteModal, setShowDeleteModal] = useState(false);
|
||||
const [selectedDocumentId, setSelectedDocumentId] = useState(null);
|
||||
const [allDocs, setAllDocs] = useState(null);
|
||||
const [respDocs, setRespDocs] = useState(null);
|
||||
const { appState } = useContext(AppContext);
|
||||
const [totalPages, setTotalPages] = useState(1);
|
||||
const { group } = appState;
|
||||
@@ -92,8 +93,21 @@ const DocumentListPage = ({ perPage }) => {
|
||||
return unsub;
|
||||
}
|
||||
|
||||
const seperateDocuments = () => {
|
||||
if (!allDocs) {
|
||||
return;
|
||||
}
|
||||
const temp = allDocs.filter((doc) => {
|
||||
return doc.docType != "interrogatories-out";
|
||||
});
|
||||
console.log("temp", temp);
|
||||
setRespDocs(temp);
|
||||
};
|
||||
|
||||
useEffect(getDocuments, [appUserId, order]);
|
||||
|
||||
useEffect(seperateDocuments, [appUserId]);
|
||||
|
||||
async function deleteFromDb(documentId) {
|
||||
if (isBusy) {
|
||||
return;
|
||||
@@ -209,8 +223,8 @@ const DocumentListPage = ({ perPage }) => {
|
||||
<></>
|
||||
)}
|
||||
<div className="document-list-lower-wrapper">
|
||||
{allDocs.length > 0 ? (
|
||||
allDocs
|
||||
{respDocs.length > 0 ? (
|
||||
respDocs
|
||||
.slice((page - 1) * perPage, page * perPage)
|
||||
.map((doc, i) => (
|
||||
<DocCard
|
||||
|
||||
Reference in New Issue
Block a user