Checkpoint: - Bouton crayon dans MesEtablissements ouvre un Dialog modal (sans mode édition préalable)
- Page Solutions Logicielles : bouton Ajouter, crayon Modifier, poubelle Supprimer (gestionnaires uniquement) - Lien espace adhérent FEHAP mis à jour vers l'URL exacte - Serveur redémarré, cache esbuild purgé, 0 erreur TypeScript
This commit is contained in:
@@ -8,6 +8,8 @@ import {
|
||||
createEditeur,
|
||||
createLocalUser,
|
||||
createSolution,
|
||||
updateSolution,
|
||||
deleteSolution,
|
||||
deleteLogicielEtablissement,
|
||||
deleteUser,
|
||||
getAllDemandes,
|
||||
@@ -150,6 +152,23 @@ export const appRouter = router({
|
||||
const isGestionnaire = ctx.user.sonumRole === "gestionnaire" || ctx.user.role === "admin";
|
||||
return createSolution(input.nom, input.editeurId, input.blocFonctionnelId, isGestionnaire);
|
||||
}),
|
||||
updateSolution: protectedProcedure
|
||||
.input(z.object({
|
||||
id: z.number().int(),
|
||||
nom: z.string().min(1),
|
||||
editeurId: z.number().int(),
|
||||
blocFonctionnelId: z.number().int().optional().nullable(),
|
||||
}))
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
if (ctx.user.sonumRole !== "gestionnaire" && ctx.user.role !== "admin") throw new TRPCError({ code: "FORBIDDEN" });
|
||||
return updateSolution(input.id, input.nom, input.editeurId, input.blocFonctionnelId ?? null);
|
||||
}),
|
||||
deleteSolution: protectedProcedure
|
||||
.input(z.object({ id: z.number().int() }))
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
if (ctx.user.sonumRole !== "gestionnaire" && ctx.user.role !== "admin") throw new TRPCError({ code: "FORBIDDEN" });
|
||||
return deleteSolution(input.id);
|
||||
}),
|
||||
}),
|
||||
|
||||
// ─── Établissements ────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user