Skip to content

wip - feat: candidature#226

Open
KGALLET wants to merge 2 commits intodevelopfrom
feat/candidatures
Open

wip - feat: candidature#226
KGALLET wants to merge 2 commits intodevelopfrom
feat/candidatures

Conversation

@KGALLET
Copy link
Collaborator

@KGALLET KGALLET commented Mar 16, 2026

No description provided.

@KGALLET KGALLET force-pushed the feat/candidatures branch from c014282 to cb9342d Compare March 17, 2026 16:42

export default async function CandidatureDetailPage({ params }: Props) {
const { id } = await params
const candidatureId = Number(id)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

UUID instead


const queryClient = getQueryClient()

await queryClient.prefetchQuery(trpc.bailleur.getCandidature.queryOptions({ id: candidatureId }))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

getCandidateDetailsPageContext


return (
<HydrationBoundary state={dehydrate(queryClient)}>
<CandidatureDetail id={candidatureId} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

remove id and rely on candidature directly from the hook / page context instead

<HydrationBoundary state={dehydratedState}>
<div className="fr-container fr-pb-12w">
<Breadcrumb
currentPageLabel={<>Gestion des candidatures</>}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No need of react node

const handleSubmit = (data: OwnerFormData) => {
updateOwner.mutate({ id: ownerId, name: data.name, url: data.url || null })
const handleSubmit = (data: TOwnerFormData) => {
updateOwner.mutate({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mutateAsync

.where(eq(dossierFacileTenants.tenantId, tenantIdStr))

if (data.documents.length > 0) {
await db.delete(dossierFacileDocuments).where(eq(dossierFacileDocuments.tenantId, existingTenant.id))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Upsert maybe better ? Check if we can update depending on document type


<div className="fr-flex fr-justify-content-space-between fr-align-items-center fr-mb-4w">
<h1 className="fr-h2 fr-mb-0">Candidature de {candidature.studentName ?? 'Candidat'}</h1>
{candidature.tenantUrl && (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Check whether we display dossierURL or dossierXXXUrl

import { useTRPC, useTRPCClient } from '~/server/trpc/client'

export const candidatureModal = createModal({
id: 'candidature-modal',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would need to add an id there, without it it will trigger for every candidates

Create dynamic modal


return useMutation({
mutationFn: (data: { id: number; name?: string; url?: string | null }) => trpcClient.admin.owners.update.mutate(data),
mutationFn: (data: { id: number; name?: string; url?: string | null; acceptDossierFacileApplications?: boolean }) =>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Zod

const isAdmin = usr?.role === 'admin'

const [accommodation] = await db
.select({ ...accommodationSelectFields, ownerId: accommodations.ownerId })
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Find first

@KGALLET KGALLET force-pushed the develop branch 2 times, most recently from 85dfd23 to 4e56fab Compare March 20, 2026 09:27
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.

1 participant