Added the ability for Corporate accounts to register without codes
This commit is contained in:
@@ -111,7 +111,7 @@ export default function OwnerDashboard({user}: Props) {
|
||||
);
|
||||
|
||||
const InactiveStudentsList = () => {
|
||||
const filter = (x: User) => x.type === "student" && (x.isDisabled || moment().isAfter(x.subscriptionExpirationDate));
|
||||
const filter = (x: User) => x.type === "student" && (x.status === "disabled" || moment().isAfter(x.subscriptionExpirationDate));
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -131,7 +131,7 @@ export default function OwnerDashboard({user}: Props) {
|
||||
};
|
||||
|
||||
const InactiveCorporateList = () => {
|
||||
const filter = (x: User) => x.type === "corporate" && (x.isDisabled || moment().isAfter(x.subscriptionExpirationDate));
|
||||
const filter = (x: User) => x.type === "corporate" && (x.status === "disabled" || moment().isAfter(x.subscriptionExpirationDate));
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -196,7 +196,11 @@ export default function OwnerDashboard({user}: Props) {
|
||||
<span className="flex flex-col gap-1 items-center text-xl">
|
||||
<span className="text-lg">Inactive Students</span>
|
||||
<span className="font-semibold text-mti-rose">
|
||||
{users.filter((x) => x.type === "student" && (x.isDisabled || moment().isAfter(x.subscriptionExpirationDate))).length}
|
||||
{
|
||||
users.filter(
|
||||
(x) => x.type === "student" && (x.status === "disabled" || moment().isAfter(x.subscriptionExpirationDate)),
|
||||
).length
|
||||
}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
@@ -207,7 +211,11 @@ export default function OwnerDashboard({user}: Props) {
|
||||
<span className="flex flex-col gap-1 items-center text-xl">
|
||||
<span className="text-lg text-center">Inactive Corporate</span>
|
||||
<span className="font-semibold text-mti-rose">
|
||||
{users.filter((x) => x.type === "corporate" && (x.isDisabled || moment().isAfter(x.subscriptionExpirationDate))).length}
|
||||
{
|
||||
users.filter(
|
||||
(x) => x.type === "corporate" && (x.status === "disabled" || moment().isAfter(x.subscriptionExpirationDate)),
|
||||
).length
|
||||
}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
@@ -219,7 +227,7 @@ export default function OwnerDashboard({user}: Props) {
|
||||
<div className="flex flex-col items-start h-96 overflow-scroll scrollbar-hide">
|
||||
{users
|
||||
.filter((x) => x.type === "student")
|
||||
.sort((a, b) => dateSorter(a, b, "asc", "registrationDate"))
|
||||
.sort((a, b) => dateSorter(a, b, "desc", "registrationDate"))
|
||||
.map((x) => (
|
||||
<UserDisplay key={x.id} {...x} />
|
||||
))}
|
||||
@@ -230,17 +238,17 @@ export default function OwnerDashboard({user}: Props) {
|
||||
<div className="flex flex-col items-start h-96 overflow-scroll scrollbar-hide">
|
||||
{users
|
||||
.filter((x) => x.type === "corporate")
|
||||
.sort((a, b) => dateSorter(a, b, "asc", "registrationDate"))
|
||||
.sort((a, b) => dateSorter(a, b, "desc", "registrationDate"))
|
||||
.map((x) => (
|
||||
<UserDisplay key={x.id} {...x} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="bg-white shadow flex flex-col rounded-xl w-full">
|
||||
<span className="p-4">Disabled Corporate</span>
|
||||
<span className="p-4">Unpaid Corporate</span>
|
||||
<div className="flex flex-col items-start h-96 overflow-scroll scrollbar-hide">
|
||||
{users
|
||||
.filter((x) => x.type === "corporate" && x.isDisabled)
|
||||
.filter((x) => x.type === "corporate" && x.status === "paymentDue")
|
||||
.map((x) => (
|
||||
<UserDisplay key={x.id} {...x} />
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user