Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add same positions for gagn #1655

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend/samfundet/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,11 +1240,15 @@ class RecruitmentApplicationForRecruitersView(APIView):

def get(self, request: Request, application_id: str) -> Response:
application = get_object_or_404(RecruitmentApplication, id=application_id)
same_gang_applications = RecruitmentApplication.objects.filter(
Copy link
Member

Choose a reason for hiding this comment

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

Kan vi ikke bare gjøre dette i frontend heller? Alle andre søknader er tilgjengelig i other_applications. I frontend kan vi bruke denne og bare filtrere etter gjeng

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mer praktisk å holde slik filtrering i backend en frontend, vil sette minst mulig komputasjon i frontend. Gjør det bedre senere, gjør det bedre for posting i dette tilfellet som kommer senere

Copy link
Contributor

Choose a reason for hiding this comment

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

Jeg er enig i at vi man heller burde filtrer dette i backend, men da trenger vi selvfølgelig ikke sende med
other_applications i applications objektet.

user=application.user, recruitment=application.recruitment, recruitment_position__gang=application.recruitment_position.resolve_gang()
).order_by('applicant_priority')
other_applications = RecruitmentApplication.objects.filter(user=application.user, recruitment=application.recruitment).order_by('applicant_priority')
Copy link
Contributor

Choose a reason for hiding this comment

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

Da kan vel dette endres slik at det ikke inneholder søkander i denne gjengen?

return Response(
data={
'application': RecruitmentApplicationForRecruiterSerializer(instance=application).data,
'user': UserForRecruitmentSerializer(instance=application.user).data,
'same_gang_applications': RecruitmentApplicationForRecruiterSerializer(same_gang_applications, many=True).data,
'other_applications': RecruitmentApplicationForRecruiterSerializer(other_applications, many=True).data,
}
)
Expand Down
1 change: 1 addition & 0 deletions frontend/src/dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ export type RecruitmentApplicationDto = {
export type RecruitmentApplicationRecruiterDto = {
user: RecruitmentUserDto;
application: RecruitmentApplicationDto;
same_gang_applications: RecruitmentApplicationDto[];
other_applications: RecruitmentApplicationDto[];
};

Expand Down
Loading