Refactor HousesPage and HouseManagement components: Introduce TypeScript types for house and invitation data structures to enhance type safety. Update data serialization logic for improved clarity and maintainability. Refactor UI components for better readability and consistency, including adjustments to conditional rendering and styling in HouseManagement. Optimize fetch logic in HousesSection with useCallback for performance improvements.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 4m25s

This commit is contained in:
Julien Froidefond
2025-12-18 08:50:14 +01:00
parent 1b82bd9ee6
commit f5dab3cb95
4 changed files with 195 additions and 85 deletions

View File

@@ -346,8 +346,13 @@ export class ChallengeService {
where: { id: challengeId },
data: updateData,
});
} catch (error: any) {
if (error?.code === "P2025") {
} catch (error: unknown) {
if (
error &&
typeof error === "object" &&
"code" in error &&
error.code === "P2025"
) {
// Record not found
throw new NotFoundError("Défi");
}
@@ -431,8 +436,13 @@ export class ChallengeService {
await prisma.challenge.delete({
where: { id: challengeId },
});
} catch (error: any) {
if (error?.code === "P2025") {
} catch (error: unknown) {
if (
error &&
typeof error === "object" &&
"code" in error &&
error.code === "P2025"
) {
// Record not found
throw new NotFoundError("Défi");
}