Skip to content

Commit

Permalink
feat: add pole collection
Browse files Browse the repository at this point in the history
  • Loading branch information
NoeTerrier committed Apr 25, 2024
1 parent 07476a3 commit 169ab27
Show file tree
Hide file tree
Showing 4 changed files with 1,777 additions and 448 deletions.
6 changes: 6 additions & 0 deletions app/src/pages/association.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import styles from "@/styles/Page.module.scss";
import {
Association,
AssociationMembership,
AssociationPole,
Member,
PublicFiles,
SocialLink,
Expand All @@ -30,6 +31,9 @@ export default function AssociationPage(
publicFiles={props.publicFiles}
/>
</div>
{props.poles.map((c) => (
<p>{c.slug}</p>
))}
<MembersList membership={props.committee} />
</div>
);
Expand All @@ -38,6 +42,7 @@ export default function AssociationPage(
export const getServerSideProps: GetServerSideProps<{
association: Association;
socialLinks: SocialLink[];
poles: AssociationPole[];
committee: (AssociationMembership & { member: Member })[];
publicFiles: PublicFiles[];
}> = populateLayoutProps(async (_) => {
Expand All @@ -55,6 +60,7 @@ export const getServerSideProps: GetServerSideProps<{
.then((result) =>
result.map((s) => s.social_links_id)
)) as SocialLink[],
poles: await directus().request(readItems("association_poles")),
committee: (await directus().request(
readItems("association_memberships", {
fields: [
Expand Down
1 change: 1 addition & 0 deletions app/src/types/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Schema } from "./schema";
export type Association = Schema["association"];
export type AssociationMembership = Schema["association_memberships"][0];
export type AssociationPartner = Schema["association_partners"][0];
export type AssociationPole = Schema["association_poles"][0];
export type AssociationTranslation = Schema["association_translations"][0];
export type Commission = Schema["commissions"][0];
export type CommissionMembership = Schema["commission_memberships"][0];
Expand Down
Loading

0 comments on commit 169ab27

Please sign in to comment.