backend: fixed wrong error codes

This commit is contained in:
Alex
2025-03-02 23:14:03 +01:00
parent 6937ab333c
commit ff3106b8be
9 changed files with 37 additions and 22 deletions

View File

@@ -40,7 +40,7 @@ func ValidateSubscription(sl validator.StructLevel) {
// This is a nested probably user struct. We are only checking if the model exists
existingSubscription, err := repositories.GetSubscriptionByName(&subscription.Name)
if err != nil || existingSubscription == nil {
sl.ReportError(subscription.Name, "Subscription_Name", "name", "exists", "")
sl.ReportError(subscription.Name, "subscription.name", "name", "duplicate", "")
}
}
}