Mark profiles as edited when importing settings into them
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/safing/portbase/api"
|
||||
"github.com/safing/portbase/config"
|
||||
@@ -253,6 +254,9 @@ func ImportSingeSetting(r *SingleSettingImportRequest) (*ImportResult, error) {
|
||||
// Set imported setting on profile.
|
||||
config.PutValueIntoHierarchicalConfig(p.Config, r.Export.ID, r.Export.Value)
|
||||
|
||||
// Mark profile as edited by user.
|
||||
p.LastEdited = time.Now().Unix()
|
||||
|
||||
// Save profile back to db.
|
||||
if err := p.Save(); err != nil {
|
||||
return nil, fmt.Errorf("%w: failed to save profile: %w", ErrImportFailed, err)
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/safing/portbase/api"
|
||||
"github.com/safing/portbase/config"
|
||||
@@ -322,6 +323,9 @@ func ImportSettings(r *SettingsImportRequest) (*ImportResult, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Mark profile as edited by user.
|
||||
p.LastEdited = time.Now().Unix()
|
||||
|
||||
// Save profile back to db.
|
||||
err = p.Save()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user