Merge pull request 'fix(ui): show subscription status on domains list' (#11) from feature/cl4-domain-status-from-subscription into master
Reviewed-on: http://gitea.lan:3000/robbond/pleskSaas/pulls/11
This commit was merged in pull request #11.
This commit is contained in:
@@ -50,7 +50,7 @@ export default async function DashboardPage() {
|
||||
supabase
|
||||
.from("plesk_domains")
|
||||
.select(
|
||||
"id, plesk_instance_id, subscription_id, domain_name, status, hosting_type, source_created_at, aliases_count, updated_at",
|
||||
"id, plesk_instance_id, subscription_id, status, domain_name, hosting_type, source_created_at, aliases_count, updated_at, subscription:plesk_subscriptions(status)",
|
||||
)
|
||||
.eq("agency_id", context.agencyId)
|
||||
.order("updated_at", { ascending: false })
|
||||
@@ -107,6 +107,9 @@ export default async function DashboardPage() {
|
||||
source_created_at: string | null;
|
||||
aliases_count: number | null;
|
||||
updated_at: string;
|
||||
subscription: {
|
||||
status: string | null;
|
||||
} | null;
|
||||
}> | null;
|
||||
},
|
||||
{ data: BillingSummary | null },
|
||||
@@ -167,7 +170,16 @@ export default async function DashboardPage() {
|
||||
<DashboardControls
|
||||
instances={instances ?? []}
|
||||
subscriptions={subscriptions ?? []}
|
||||
domains={domains ?? []}
|
||||
domains={(domains ?? []).map((domain) => {
|
||||
const joinedStatus = Array.isArray(domain.subscription)
|
||||
? domain.subscription[0]?.status
|
||||
: domain.subscription?.status;
|
||||
|
||||
return {
|
||||
...domain,
|
||||
status: joinedStatus ?? "unknown",
|
||||
};
|
||||
})}
|
||||
autoSyncByInstance={Object.fromEntries(autoSyncByInstance.entries())}
|
||||
/>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user