Open
Conversation
c014282 to
cb9342d
Compare
KGALLET
commented
Mar 17, 2026
|
|
||
| export default async function CandidatureDetailPage({ params }: Props) { | ||
| const { id } = await params | ||
| const candidatureId = Number(id) |
|
|
||
| const queryClient = getQueryClient() | ||
|
|
||
| await queryClient.prefetchQuery(trpc.bailleur.getCandidature.queryOptions({ id: candidatureId })) |
Collaborator
Author
There was a problem hiding this comment.
getCandidateDetailsPageContext
|
|
||
| return ( | ||
| <HydrationBoundary state={dehydrate(queryClient)}> | ||
| <CandidatureDetail id={candidatureId} /> |
Collaborator
Author
There was a problem hiding this comment.
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</>} |
Collaborator
Author
There was a problem hiding this comment.
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({ |
| .where(eq(dossierFacileTenants.tenantId, tenantIdStr)) | ||
|
|
||
| if (data.documents.length > 0) { | ||
| await db.delete(dossierFacileDocuments).where(eq(dossierFacileDocuments.tenantId, existingTenant.id)) |
Collaborator
Author
There was a problem hiding this comment.
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 && ( |
Collaborator
Author
There was a problem hiding this comment.
Check whether we display dossierURL or dossierXXXUrl
| import { useTRPC, useTRPCClient } from '~/server/trpc/client' | ||
|
|
||
| export const candidatureModal = createModal({ | ||
| id: 'candidature-modal', |
Collaborator
Author
There was a problem hiding this comment.
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 }) => |
| const isAdmin = usr?.role === 'admin' | ||
|
|
||
| const [accommodation] = await db | ||
| .select({ ...accommodationSelectFields, ownerId: accommodations.ownerId }) |
85dfd23 to
4e56fab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.