feat: get accounts by path

This commit is contained in:
Noah Hsu
2022-06-09 23:05:27 +08:00
parent e1a2ed0436
commit 164dab49ac
4 changed files with 64 additions and 8 deletions

View File

@ -20,7 +20,7 @@ func DeleteAccountById(id uint) error {
return errors.WithStack(db.Delete(&model.Account{}, id).Error)
}
// GetAccounts Get all accounts from database
// GetAccounts Get all accounts from database order by index
func GetAccounts() ([]model.Account, error) {
var accounts []model.Account
if err := db.Order(columnName("index")).Find(&accounts).Error; err != nil {