diff options
Diffstat (limited to 'internal/processing/account')
-rw-r--r-- | internal/processing/account/update.go | 8 | ||||
-rw-r--r-- | internal/processing/account/update_test.go | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/internal/processing/account/update.go b/internal/processing/account/update.go index 537857cee..a96c17eeb 100644 --- a/internal/processing/account/update.go +++ b/internal/processing/account/update.go @@ -79,7 +79,7 @@ func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, form // Process note to generate a valid HTML representation var f text.FormatFunc - if account.StatusFormat == "markdown" { + if account.StatusContentType == "text/markdown" { f = p.formatter.FromMarkdown } else { f = p.formatter.FromPlain @@ -144,12 +144,12 @@ func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, form account.Privacy = privacy } - if form.Source.StatusFormat != nil { - if err := validate.StatusFormat(*form.Source.StatusFormat); err != nil { + if form.Source.StatusContentType != nil { + if err := validate.StatusContentType(*form.Source.StatusContentType); err != nil { return nil, gtserror.NewErrorBadRequest(err, err.Error()) } - account.StatusFormat = *form.Source.StatusFormat + account.StatusContentType = *form.Source.StatusContentType } } diff --git a/internal/processing/account/update_test.go b/internal/processing/account/update_test.go index 8ebce7888..486848549 100644 --- a/internal/processing/account/update_test.go +++ b/internal/processing/account/update_test.go @@ -122,13 +122,13 @@ func (suite *AccountUpdateTestSuite) TestAccountUpdateWithMarkdownNote() { Note: ¬e, } - // set default post language of account 1 to markdown - testAccount.StatusFormat = "markdown" + // set default post content type of account 1 to markdown + testAccount.StatusContentType = "text/markdown" // should get no error from the update function, and an api model account returned apiAccount, errWithCode := suite.accountProcessor.Update(context.Background(), testAccount, form) // reset test account to avoid breaking other tests - testAccount.StatusFormat = "plain" + testAccount.StatusContentType = "text/plain" suite.NoError(errWithCode) suite.NotNil(apiAccount) |