Skip to content

feat(admin): add committee overview with interview capacity status an…#433

Open
akselmat wants to merge 5 commits into
mainfrom
committee-overview
Open

feat(admin): add committee overview with interview capacity status an…#433
akselmat wants to merge 5 commits into
mainfrom
committee-overview

Conversation

@akselmat
Copy link
Copy Markdown

@akselmat akselmat commented Mar 1, 2026

…d period API

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
online-opptak Ready Ready Preview, Comment Mar 1, 2026 4:18pm
opptaksside-matching Ready Ready Preview, Comment Mar 1, 2026 4:18pm

Request Review

akselmat and others added 3 commits March 1, 2026 17:08
The type was never exported from types.ts, causing the build to fail
after merging main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@jorgengaldal jorgengaldal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gjerne ta en titt på kommentarene.

Comment thread lib/api/committeesApi.ts

export const fetchCommitteesByPeriod = async (
context: QueryFunctionContext,
) => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

legg til returtype på funksjonen

const session = await getServerSession(req, res, authOptions);

if (!hasSession(res, session)) return;
if (!isAdmin(res, session)) return;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tenker for API-strukturens del at det kanskje kunne vært bedre å ha på en fil api/committees/index.ts, slik at vi kan gruppere sammen ting basert på hva man henter ut, uten å måtte ha mange egne paths for hva man henter etter.

Comment on lines +25 to +42
const getApplicantCommittees = (applicant: applicantType): string[] => {
const preferences = applicant.preferences;
const preferenceCommittees: string[] =
(preferences as preferencesType).first !== undefined
? [
(preferences as preferencesType).first,
(preferences as preferencesType).second,
(preferences as preferencesType).third,
]
: (preferences as unknown as { committee: string }[]).map(
(preference) => preference.committee,
);

return [
...preferenceCommittees.filter((committee) => committee),
...(applicant.optionalCommittees ?? []),
];
};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const getApplicantCommittees = (applicant: applicantType): string[] => {
const preferences = applicant.preferences;
const preferenceCommittees: string[] =
(preferences as preferencesType).first !== undefined
? [
(preferences as preferencesType).first,
(preferences as preferencesType).second,
(preferences as preferencesType).third,
]
: (preferences as unknown as { committee: string }[]).map(
(preference) => preference.committee,
);
return [
...preferenceCommittees.filter((committee) => committee),
...(applicant.optionalCommittees ?? []),
];
};
const getApplicantCommittees = (applicant: applicantType): string[] => {
const preferences = applicant.preferences;
const preferenceCommittees: string[] = [
preferences.first,
preferences.second,
preferences.third,
].filter((committee) => committee);
return [...preferenceCommittees, ...(applicant.optionalCommittees ?? [])];
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Var det en spesiell grunn til at den var sånn dobbelt før?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants