mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-17 21:25:54 +02:00
Merge pull request #1197 from OpenSignLabs/validation
This commit is contained in:
@@ -100,17 +100,19 @@ export async function fetchSubscriptionInfo() {
|
||||
const planId =
|
||||
tenatRes.data?.result?.result?.SubscriptionDetails?.data?.subscription
|
||||
?.subscription_id;
|
||||
const plan_code =
|
||||
tenatRes.data?.result?.result?.SubscriptionDetails?.data?.subscription
|
||||
?.plan?.plan_code;
|
||||
const plan_code = tenatRes.data?.result?.result?.PlanCode;
|
||||
const totalAllowedUser = tenatRes.data?.result?.result?.AllowedUsers || 0;
|
||||
const adminId =
|
||||
tenatRes?.data?.result?.result?.ExtUserPtr?.objectId || "";
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
price: price,
|
||||
totalPrice: totalPrice,
|
||||
planId: planId,
|
||||
plan_code: plan_code,
|
||||
totalAllowedUser: totalAllowedUser
|
||||
totalAllowedUser: totalAllowedUser,
|
||||
adminId: adminId
|
||||
};
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
@@ -135,7 +135,7 @@ const TeamList = () => {
|
||||
const handleFormModal = () => {
|
||||
setIsModal(!isModal);
|
||||
};
|
||||
// Get current list
|
||||
// to slice out 10 objects from array for current page
|
||||
const indexOfLastDoc = currentPage * recordperPage;
|
||||
const indexOfFirstDoc = indexOfLastDoc - recordperPage;
|
||||
const currentList = teamList?.slice(indexOfFirstDoc, indexOfLastDoc);
|
||||
@@ -147,7 +147,8 @@ const TeamList = () => {
|
||||
|
||||
// Change page
|
||||
const paginateFront = () => {
|
||||
if (currentPage < Math.max(...pageNumbers)) {
|
||||
const lastValue = pageNumbers?.[pageNumbers?.length - 1];
|
||||
if (currentPage < lastValue) {
|
||||
setCurrentPage(currentPage + 1);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -85,6 +85,10 @@ const UserList = () => {
|
||||
return pages;
|
||||
};
|
||||
const pageNumbers = getPaginationRange();
|
||||
// to slice out 10 objects from array for current page
|
||||
const indexOfLastDoc = currentPage * recordperPage;
|
||||
const indexOfFirstDoc = indexOfLastDoc - recordperPage;
|
||||
const currentList = userList?.slice(indexOfFirstDoc, indexOfLastDoc);
|
||||
useEffect(() => {
|
||||
fetchUserList();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
@@ -129,7 +133,8 @@ const UserList = () => {
|
||||
|
||||
// Change page
|
||||
const paginateFront = () => {
|
||||
if (currentPage < Math.max(...pageNumbers)) {
|
||||
const lastValue = pageNumbers?.[pageNumbers?.length - 1];
|
||||
if (currentPage < lastValue) {
|
||||
setCurrentPage(currentPage + 1);
|
||||
}
|
||||
};
|
||||
@@ -237,7 +242,7 @@ const UserList = () => {
|
||||
<tbody className="text-[12px]">
|
||||
{userList?.length > 0 && (
|
||||
<>
|
||||
{userList.map((item, index) => (
|
||||
{currentList.map((item, index) => (
|
||||
<tr className="border-y-[1px]" key={index}>
|
||||
{heading.includes("Sr.No") && (
|
||||
<th className="px-4 py-2">
|
||||
|
||||
@@ -373,7 +373,8 @@ const ReportTable = (props) => {
|
||||
|
||||
// Change page
|
||||
const paginateFront = () => {
|
||||
if (currentPage < Math.max(...pageNumbers)) {
|
||||
const lastValue = pageNumbers?.[pageNumbers?.length - 1];
|
||||
if (currentPage < lastValue) {
|
||||
setCurrentPage(currentPage + 1);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user