Merge branch 'Wei-Shaw:main' into main
This commit is contained in:
@@ -67,6 +67,7 @@ func (r *accountRepository) Create(ctx context.Context, account *service.Account
|
||||
|
||||
builder := r.client.Account.Create().
|
||||
SetName(account.Name).
|
||||
SetNillableNotes(account.Notes).
|
||||
SetPlatform(account.Platform).
|
||||
SetType(account.Type).
|
||||
SetCredentials(normalizeJSONMap(account.Credentials)).
|
||||
@@ -270,6 +271,7 @@ func (r *accountRepository) Update(ctx context.Context, account *service.Account
|
||||
|
||||
builder := r.client.Account.UpdateOneID(account.ID).
|
||||
SetName(account.Name).
|
||||
SetNillableNotes(account.Notes).
|
||||
SetPlatform(account.Platform).
|
||||
SetType(account.Type).
|
||||
SetCredentials(normalizeJSONMap(account.Credentials)).
|
||||
@@ -320,6 +322,9 @@ func (r *accountRepository) Update(ctx context.Context, account *service.Account
|
||||
} else {
|
||||
builder.ClearSessionWindowStatus()
|
||||
}
|
||||
if account.Notes == nil {
|
||||
builder.ClearNotes()
|
||||
}
|
||||
|
||||
updated, err := builder.Save(ctx)
|
||||
if err != nil {
|
||||
@@ -1065,6 +1070,7 @@ func accountEntityToService(m *dbent.Account) *service.Account {
|
||||
return &service.Account{
|
||||
ID: m.ID,
|
||||
Name: m.Name,
|
||||
Notes: m.Notes,
|
||||
Platform: m.Platform,
|
||||
Type: m.Type,
|
||||
Credentials: copyJSONMap(m.Credentials),
|
||||
|
||||
@@ -26,6 +26,7 @@ func TestMigrationsRunner_IsIdempotent_AndSchemaIsUpToDate(t *testing.T) {
|
||||
requireColumn(t, tx, "users", "notes", "text", 0, false)
|
||||
|
||||
// accounts: schedulable and rate-limit fields
|
||||
requireColumn(t, tx, "accounts", "notes", "text", 0, true)
|
||||
requireColumn(t, tx, "accounts", "schedulable", "boolean", 0, false)
|
||||
requireColumn(t, tx, "accounts", "rate_limited_at", "timestamp with time zone", 0, true)
|
||||
requireColumn(t, tx, "accounts", "rate_limit_reset_at", "timestamp with time zone", 0, true)
|
||||
|
||||
Reference in New Issue
Block a user