Skip to content

Commit

Permalink
formating
Browse files Browse the repository at this point in the history
  • Loading branch information
magsyg committed Dec 11, 2024
1 parent eca8a1e commit f5a22d4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
6 changes: 5 additions & 1 deletion backend/samfundet/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@
views.RecruitmentInterviewGroupView.as_view(),
name='recruitment_shared_interviews',
),
path('recruitment-positions-gang-for-gangs/<int:recruitment_id>/<int:gang_id>/', views.RecruitmentPositionsPerGangForGangView.as_view(), name='recruitment_positions_gang_for_gangs'),
path(
'recruitment-positions-gang-for-gangs/<int:recruitment_id>/<int:gang_id>/',
views.RecruitmentPositionsPerGangForGangView.as_view(),
name='recruitment_positions_gang_for_gangs',
),
path('recruitment-set-interview/<slug:pk>/', views.RecruitmentApplicationSetInterviewView.as_view(), name='recruitment_set_interview'),
path(
'recruitment-application-states-choices',
Expand Down
5 changes: 2 additions & 3 deletions backend/samfundet/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,10 +756,9 @@ def get(self, request: Request, recruitment_id: int, gang_id: int) -> Response:
gang = get_object_or_404(Gang, id=gang_id)
recruitment = get_object_or_404(Recruitment, id=recruitment_id)
if recruitment.resolve_org() != gang.resolve_org():
return Response("Gang not found in recruitment organization", status=status.HTTP_404_NOT_FOUND)
return Response('Gang not found in recruitment organization', status=status.HTTP_404_NOT_FOUND)
data = RecruitmentPosition.objects.filter(gang=gang, recruitment=recruitment)
return Response(data=self.serializer_class(data,many=True).data, status=status.HTTP_200_OK)

return Response(data=self.serializer_class(data, many=True).data, status=status.HTTP_200_OK)


class SendRejectionMailView(APIView):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { useTitle } from '~/hooks';
import { STATUS } from '~/http_status_codes';
import { KEY } from '~/i18n/constants';
import { reverse } from '~/named-urls';
import type { RecruitmentGangLoader } from '~/router/loaders';
import { ROUTES } from '~/routes';
import { dbT, getObjectFieldOrNumber, lowerCapitalize } from '~/utils';
import { AdminPageLayout } from '../AdminPageLayout/AdminPageLayout';
import styles from './RecruitmentGangAdminPage.module.scss';
import { RecruitmentGangLoader } from '~/router/loaders';

export function RecruitmentGangAdminPage() {
const { recruitmentId, gangId } = useParams();
Expand All @@ -34,26 +34,24 @@ export function RecruitmentGangAdminPage() {
// biome-ignore lint/correctness/useExhaustiveDependencies: t and navigate do not need to be in deplist
useEffect(() => {
if (recruitmentId && gangId) {
getRecruitmentPositionsGangForGang(recruitmentId, gangId).then((data) => {
setRecruitmentPositions(data.data);
})
.catch((data) => {
if (data.request.status === STATUS.HTTP_404_NOT_FOUND) {
navigate(ROUTES.frontend.not_found, { replace: true });
}
toast.error(t(KEY.common_something_went_wrong));
})
getRecruitmentPositionsGangForGang(recruitmentId, gangId)
.then((data) => {
setRecruitmentPositions(data.data);
})
.catch((data) => {
if (data.request.status === STATUS.HTTP_404_NOT_FOUND) {
navigate(ROUTES.frontend.not_found, { replace: true });
}
toast.error(t(KEY.common_something_went_wrong));
});
}
}, [recruitmentId, gangId]);


useEffect(()=> {
if(recruitmentPositions && gang && gang) {
useEffect(() => {
if (recruitmentPositions && gang && gang) {
setShowSpinner(false);
}
},
[recruitmentPositions, gang, recruitment]
)
}, [recruitmentPositions, gang, recruitment]);

useEffect(() => {
if (loader) {
Expand All @@ -62,8 +60,6 @@ export function RecruitmentGangAdminPage() {
}
}, [loader]);



const tableColumns = [
{ content: t(KEY.recruitment_position), sortable: true },
{ content: t(KEY.recruitment_jobtype), sortable: true },
Expand Down

0 comments on commit f5a22d4

Please sign in to comment.