feat(account): use token instead of id for rename

This commit is contained in:
Leon
2025-12-09 15:47:55 +08:00
parent 6c0b8c7d7a
commit f122a6170d
3 changed files with 24 additions and 5 deletions

View File

@@ -27,8 +27,8 @@ func (as *AccountService) CreateAccount(account *Account) error {
return nil
}
func (as *AccountService) RenameByID(id uint, newUsername string) error {
if err := as.accountRepository.RenameByID(id, newUsername); err != nil {
func (as *AccountService) Rename(accountID uint, newUsername string) error {
if err := as.accountRepository.Rename(accountID, newUsername); err != nil {
return err
}
return nil