add checkbox styling, driverslicence handling and validation

This commit is contained in:
Alex
2024-10-02 14:32:14 +02:00
parent 4ee18f21f2
commit cafe030e79
17 changed files with 303 additions and 44 deletions

View File

@@ -17,11 +17,12 @@ import (
)
type UserController struct {
Service services.UserServiceInterface
EmailService *services.EmailService
ConsentService services.ConsentServiceInterface
BankAccountService services.BankAccountServiceInterface
MembershipService services.MembershipServiceInterface
Service services.UserServiceInterface
EmailService *services.EmailService
ConsentService services.ConsentServiceInterface
BankAccountService services.BankAccountServiceInterface
MembershipService services.MembershipServiceInterface
DriversLicenceService services.DriversLicenceInterface
}
type RegistrationData struct {
@@ -129,10 +130,17 @@ func (uc *UserController) CurrentUserHandler(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error retrieving subscriptions."})
return
}
licenceCategories, err := uc.DriversLicenceService.GetAllCategories()
if err != nil {
logger.Error.Printf("Error retrieving licence categories: %v", err)
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error retrieving licence categories."})
return
}
logger.Error.Printf("licenceCategories: %#v", licenceCategories)
c.JSON(http.StatusOK, gin.H{
"user": user.Safe(),
"subscriptions": subscriptions,
"user": user.Safe(),
"subscriptions": subscriptions,
"licence_categories": licenceCategories,
})
}