diff --git a/package-lock.json b/package-lock.json index 125748ecc..c0beb5d39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "react-dom": "^18.2.0", "react-icons": "^4.10.1", "react-toastify": "^9.1.3", + "secure-random-password": "^0.2.3", "shiki": "^0.14.1", "socket.io-client": "^4.6.2", "tailwind-scrollbar": "^3.0.4", @@ -44,6 +45,7 @@ "devDependencies": { "@types/crypto-js": "^4.1.1", "@types/eslint": "^8.21.1", + "@types/secure-random-password": "^0.2.1", "@typescript-eslint/eslint-plugin": "^5.54.1", "@typescript-eslint/parser": "^5.54.1", "astro-eslint-parser": "^0.11.0", @@ -1626,6 +1628,12 @@ "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz", "integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==" }, + "node_modules/@types/secure-random-password": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@types/secure-random-password/-/secure-random-password-0.2.1.tgz", + "integrity": "sha512-tpG5oVF+NpIS9UJ9ttXAokafyhE/MCZBg65D345qu3gOM4YoJ/mFNVzUDUNBfb1hIi598bNOzvY04BbfS7VKwA==", + "dev": true + }, "node_modules/@types/semver": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", @@ -11048,6 +11056,19 @@ "node": ">=4" } }, + "node_modules/secure-random": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/secure-random/-/secure-random-1.1.2.tgz", + "integrity": "sha512-H2bdSKERKdBV1SwoqYm6C0y+9EA94v6SUBOWO8kDndc4NoUih7Dv6Tsgma7zO1lv27wIvjlD0ZpMQk7um5dheQ==" + }, + "node_modules/secure-random-password": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/secure-random-password/-/secure-random-password-0.2.3.tgz", + "integrity": "sha512-2zpmr6pK3CZGIS9fgApFw00/tKEBVbJTqe4AZLrLNgahCK6ueIR5uMzvbERNibr8hkWneMcOqDcm4wpHWUxrYw==", + "dependencies": { + "secure-random": "^1.1.2" + } + }, "node_modules/semver": { "version": "7.5.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", diff --git a/src/components/organization/OrganizationsList.tsx b/src/components/organization/OrganizationsList.tsx index fe76c3866..9845cce07 100644 --- a/src/components/organization/OrganizationsList.tsx +++ b/src/components/organization/OrganizationsList.tsx @@ -61,16 +61,16 @@ const OrganizationsList = () => { return userOrg; }) - if (orgList.length === 0) { - setError('No Data Found') - } - setOrganizationList(orgList) setCurrentPage({ ...currentPage, total: totalPages }) } + else{ + setError(response as string) + + } setLoading(false) } @@ -151,6 +151,16 @@ const OrganizationsList = () => { setOpenModal={ props.setOpenModal } /> + + { + setMessage(null) + setError(null) + }} + /> + {loading ?
{ const invitationList = data?.data?.invitations - if (invitationList.length === 0) { - setError('No Data Found') - } setInvitationsList(invitationList) setCurrentPage({ ...currentPage, total: totalPages }) } + else { + setError(response as string) + + } } //This useEffect is called when the searchText changes @@ -123,6 +124,15 @@ const Invitations = () => { props.setOpenModal } /> + { + setMessage(null) + setError(null) + }} + /> + {loading ?
{ const totalPages = data?.data?.totalPages; const invitationList = data?.data?.invitations - if (invitationList.length === 0) { - setError('No Data Found') - } + setInvitationsList(invitationList) setCurrentPage({ ...currentPage, total: totalPages }) } + else { + setError(response as string) + } setLoading(false) } @@ -135,6 +136,16 @@ const ReceivedInvitations = () => { props.setOpenModal } /> + { + setMessage(null) + setError(null) + }} + /> + + {loading ?