diff options
author | 2023-09-23 17:44:11 +0100 | |
---|---|---|
committer | 2023-09-23 18:44:11 +0200 | |
commit | 8f67dd583d86155440e7905ae23083a9fea42f72 (patch) | |
tree | e67abf09a53c2d9053df8072b074a026969d93ef /internal/processing/report | |
parent | [chore] fix typo in slice.go (#2219) (diff) | |
download | gotosocial-8f67dd583d86155440e7905ae23083a9fea42f72.tar.xz |
[chore] deinterface the typeutils.Converter and update to use state structure (#2217)
* update typeconverter to use state structure
* deinterface the typeutils.TypeConverter -> typeutils.Converter
* finish copying over old type converter code comments
* fix cherry-pick merge issues, fix tests pointing to old typeutils interface type still
Diffstat (limited to 'internal/processing/report')
-rw-r--r-- | internal/processing/report/create.go | 2 | ||||
-rw-r--r-- | internal/processing/report/get.go | 4 | ||||
-rw-r--r-- | internal/processing/report/report.go | 10 |
3 files changed, 8 insertions, 8 deletions
diff --git a/internal/processing/report/create.go b/internal/processing/report/create.go index 48f9c1ee4..c65ae0d52 100644 --- a/internal/processing/report/create.go +++ b/internal/processing/report/create.go @@ -99,7 +99,7 @@ func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, form TargetAccount: targetAccount, }) - apiReport, err := p.tc.ReportToAPIReport(ctx, report) + apiReport, err := p.converter.ReportToAPIReport(ctx, report) if err != nil { err = fmt.Errorf("error converting report to frontend representation: %w", err) return nil, gtserror.NewErrorInternalError(err) diff --git a/internal/processing/report/get.go b/internal/processing/report/get.go index f39648832..c5c4fc223 100644 --- a/internal/processing/report/get.go +++ b/internal/processing/report/get.go @@ -45,7 +45,7 @@ func (p *Processor) Get(ctx context.Context, account *gtsmodel.Account, id strin return nil, gtserror.NewErrorNotFound(err) } - apiReport, err := p.tc.ReportToAPIReport(ctx, report) + apiReport, err := p.converter.ReportToAPIReport(ctx, report) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting report to api: %s", err)) } @@ -79,7 +79,7 @@ func (p *Processor) GetMultiple( prevMinIDValue := reports[0].ID for _, r := range reports { - item, err := p.tc.ReportToAPIReport(ctx, r) + item, err := p.converter.ReportToAPIReport(ctx, r) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting report to api: %s", err)) } diff --git a/internal/processing/report/report.go b/internal/processing/report/report.go index 2fb11bc7f..c871172bb 100644 --- a/internal/processing/report/report.go +++ b/internal/processing/report/report.go @@ -23,13 +23,13 @@ import ( ) type Processor struct { - state *state.State - tc typeutils.TypeConverter + state *state.State + converter *typeutils.Converter } -func New(state *state.State, tc typeutils.TypeConverter) Processor { +func New(state *state.State, converter *typeutils.Converter) Processor { return Processor{ - state: state, - tc: tc, + state: state, + converter: converter, } } |