mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-26 12:30:27 +00:00
remove currency validation
This commit is contained in:
parent
2240617c8e
commit
e647419eed
11 changed files with 92 additions and 143 deletions
|
@ -28,7 +28,7 @@ func NewGroupRepository(db *ent.Client) *GroupRepository {
|
|||
Name: g.Name,
|
||||
CreatedAt: g.CreatedAt,
|
||||
UpdatedAt: g.UpdatedAt,
|
||||
Currency: strings.ToUpper(g.Currency.String()),
|
||||
Currency: strings.ToUpper(g.Currency),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -265,11 +265,9 @@ func (r *GroupRepository) GroupCreate(ctx context.Context, name string) (Group,
|
|||
}
|
||||
|
||||
func (r *GroupRepository) GroupUpdate(ctx context.Context, ID uuid.UUID, data GroupUpdate) (Group, error) {
|
||||
currency := group.Currency(strings.ToLower(data.Currency))
|
||||
|
||||
entity, err := r.db.Group.UpdateOneID(ID).
|
||||
SetName(data.Name).
|
||||
SetCurrency(currency).
|
||||
SetCurrency(strings.ToLower(data.Currency)).
|
||||
Save(ctx)
|
||||
|
||||
return r.groupMapper.MapErr(entity, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue