locale &update handling

This commit is contained in:
Alex
2025-03-01 15:29:34 +01:00
parent c28354ed2d
commit ac0b7234d4
4 changed files with 13 additions and 13 deletions

View File

@@ -66,6 +66,7 @@ export default {
'Registrierung erfolgreicht, leider konnte die Verifizierungs-E-Mail nicht versendet werden. Bitte wenden Sie sich an den Verein um Ihre Emailadresse zu bestätigen und Ihren Account zu aktivieren.' 'Registrierung erfolgreicht, leider konnte die Verifizierungs-E-Mail nicht versendet werden. Bitte wenden Sie sich an den Verein um Ihre Emailadresse zu bestätigen und Ihren Account zu aktivieren.'
}, },
validation: { validation: {
invalid: 'ungültig',
invalid_user_id: 'Nutzer ID ungültig', invalid_user_id: 'Nutzer ID ungültig',
invalid_subscription_model: 'Model nicht gefunden', invalid_subscription_model: 'Model nicht gefunden',
user_not_found: '{field} konnte nicht gefunden werden', user_not_found: '{field} konnte nicht gefunden werden',
@@ -86,7 +87,9 @@ export default {
image: 'Dies ist kein Bild', image: 'Dies ist kein Bild',
alphanum: 'beinhaltet ungültige Zeichen', alphanum: 'beinhaltet ungültige Zeichen',
user_disabled: 'Benutzer ist deaktiviert', user_disabled: 'Benutzer ist deaktiviert',
alphaunicode: 'darf nur aus Buchstaben bestehen' duplicate: 'Schon vorhanden..',
alphaunicode: 'darf nur aus Buchstaben bestehen',
too_soon: 'zu früh'
} }
}, },
licenceCategory: { licenceCategory: {

View File

@@ -19,8 +19,6 @@ export function formDataToObject(formData) {
} }
/** @type {string[]} */ /** @type {string[]} */
const keys = key.match(/\[([^\]]+)\]/g)?.map((k) => k.slice(1, -1)) || [key]; const keys = key.match(/\[([^\]]+)\]/g)?.map((k) => k.slice(1, -1)) || [key];
console.log('Processed keys:', keys);
console.dir(value);
/** @type {Record<string, any>} */ /** @type {Record<string, any>} */
let current = object; let current = object;

View File

@@ -99,15 +99,14 @@ func (uc *UserController) UpdateHandler(c *gin.Context) {
utils.RespondWithError(c, err, "Error finding an existing user", http.StatusNotFound, errors.Responses.Fields.User, errors.Responses.Keys.NotFound) utils.RespondWithError(c, err, "Error finding an existing user", http.StatusNotFound, errors.Responses.Fields.User, errors.Responses.Keys.NotFound)
return return
} }
// user.Membership.ID = existingUser.Membership.ID user.MembershipID = existingUser.MembershipID
user.Membership.ID = existingUser.Membership.ID
// user.MembershipID = existingUser.MembershipID if existingUser.Licence != nil {
// if existingUser.Licence != nil { user.Licence.ID = existingUser.Licence.ID
// user.Licence.ID = existingUser.Licence.ID }
// } user.LicenceID = existingUser.LicenceID
// user.LicenceID = existingUser.LicenceID user.BankAccount.ID = existingUser.BankAccount.ID
// user.BankAccount.ID = existingUser.BankAccount.ID user.BankAccountID = existingUser.BankAccountID
// user.BankAccountID = existingUser.BankAccountID
if requestUser.RoleID <= constants.Priviliges.View { if requestUser.RoleID <= constants.Priviliges.View {
existingUser.Password = "" existingUser.Password = ""

View File

@@ -46,9 +46,9 @@ func HandleUserUpdateError(c *gin.Context, err error) {
case errors.ErrSubscriptionNotFound: case errors.ErrSubscriptionNotFound:
RespondWithError(c, err, "Couldn't find subscription", http.StatusNotFound, errors.Responses.Fields.SubscriptionModel, errors.Responses.Keys.NotFound) RespondWithError(c, err, "Couldn't find subscription", http.StatusNotFound, errors.Responses.Fields.SubscriptionModel, errors.Responses.Keys.NotFound)
default: default:
}
RespondWithError(c, err, "Couldn't update user", http.StatusInternalServerError, errors.Responses.Fields.User, errors.Responses.Keys.InternalServerError) RespondWithError(c, err, "Couldn't update user", http.StatusInternalServerError, errors.Responses.Fields.User, errors.Responses.Keys.InternalServerError)
} }
}
func HandleSubscriptionDeleteError(c *gin.Context, err error) { func HandleSubscriptionDeleteError(c *gin.Context, err error) {
switch err { switch err {