From 355db3ab9b65ce58fc4539751e5225c269f35530 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Thu, 16 Jun 2022 21:29:39 +0800 Subject: [PATCH] feat: standardization virtual path while create and update --- internal/operations/account.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/operations/account.go b/internal/operations/account.go index 97b83f8802d..e897530d026 100644 --- a/internal/operations/account.go +++ b/internal/operations/account.go @@ -31,6 +31,7 @@ func GetAccountByVirtualPath(virtualPath string) (driver.Driver, error) { // then instantiate corresponding driver and save it in memory func CreateAccount(ctx context.Context, account model.Account) error { account.Modified = time.Now() + account.VirtualPath = utils.StandardizationPath(account.VirtualPath) err := store.CreateAccount(&account) if err != nil { return errors.WithMessage(err, "failed create account in database") @@ -59,6 +60,7 @@ func UpdateAccount(ctx context.Context, account model.Account) error { return errors.WithMessage(err, "failed get old account") } account.Modified = time.Now() + account.VirtualPath = utils.StandardizationPath(account.VirtualPath) err = store.UpdateAccount(&account) if err != nil { return errors.WithMessage(err, "failed update account in database")