feat: enhance security handling by adding refetch capability and improving error messages in security service

This commit is contained in:
Mauricio Siu
2026-02-25 23:30:28 -06:00
parent 0adfa51174
commit 4baf77c740
3 changed files with 33 additions and 11 deletions

View File

@@ -46,7 +46,7 @@ export const HandleSecurity = ({
}: Props) => {
const utils = api.useUtils();
const [isOpen, setIsOpen] = useState(false);
const { data } = api.security.one.useQuery(
const { data, refetch } = api.security.one.useQuery(
{
securityId: securityId ?? "",
},
@@ -88,6 +88,7 @@ export const HandleSecurity = ({
await utils.application.readTraefikConfig.invalidate({
applicationId,
});
await refetch();
setIsOpen(false);
})
.catch(() => {

View File

@@ -43,7 +43,7 @@ export const securityRouter = createTRPCRouter({
message: "You are not authorized to access this application",
});
}
return await findSecurityById(input.securityId);
return security;
}),
delete: protectedProcedure
.input(apiFindOneSecurity)