Skip to content

Commit

Permalink
[ui] Only show active statDefinitions and externalIdentTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
hhssb committed Nov 6, 2024
1 parent 215aa2d commit 9a82319
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions app/src/app/BaseDataServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { createSupabaseSSRClient } from "@/utils/supabase/server";
import { ClientBaseDataProvider } from "./BaseDataClient";

export interface BaseData {
statDefinitions: Tables<"stat_definition_ordered">[];
externalIdentTypes: Tables<"external_ident_type_ordered">[];
statDefinitions: Tables<"stat_definition_active">[];
externalIdentTypes: Tables<"external_ident_type_active">[];
timeContexts: Tables<"time_context">[];
defaultTimeContext: Tables<"time_context">;
hasStatisticalUnits: boolean;
Expand All @@ -25,10 +25,10 @@ export async function getBaseData(client: SupabaseClient): Promise<BaseData> {
{ data: maybeStatDefinitions },
{ data: maybeExternalIdentTypes },
{ data: maybeTimeContexts },
{ data: maybeStatisticalUnit},
{ data: maybeStatisticalUnit },
] = await Promise.all([
client.from("stat_definition_ordered").select(),
client.from("external_ident_type_ordered").select(),
client.from("stat_definition_active").select(),
client.from("external_ident_type_active").select(),
client.from("time_context").select(),
client.from("statistical_unit").select("*").limit(1),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ActiveExternalIdentBadges } from "./active-external-ident-badges";
export default async function ExternalIdentFilter() {
const client = await createSupabaseSSRClient();
const externalIdentTypes = await client
.from("external_ident_type_ordered")
.from("external_ident_type_active")
.select();

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { FilterWrapper } from "../../components/filter-wrapper";

export default async function StatisticalVariablesFilter() {
const client = await createSupabaseSSRClient();
const statDefinitions = await client
.from("stat_definition_ordered")
.select();
const statDefinitions = await client.from("stat_definition_active").select();

return (
<>
Expand Down

0 comments on commit 9a82319

Please sign in to comment.