Model refactor, part 2 (#4092)

* Move conversions into changesetTranslator
* Improve mutation error messages
* Use models.New and models.NewPartial everywhere
* Replace getStashIDsFor functions
* Remove ImageCreateInput
* Remove unused parameters
* Refactor matching functions
---------
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
DingDongSoLong4
2023-09-11 04:24:15 +02:00
committed by GitHub
parent cf3301c8bc
commit 24e4719abc
61 changed files with 1514 additions and 1407 deletions

View File

@@ -72,7 +72,7 @@ func (t *GenerateCoverTask) Start(ctx context.Context) {
if err := t.txnManager.WithTxn(ctx, func(ctx context.Context) error {
qb := t.txnManager.Scene
updatedScene := models.NewScenePartial()
scenePartial := models.NewScenePartial()
// update the scene cover table
if err := qb.UpdateCover(ctx, t.Scene.ID, coverImageData); err != nil {
@@ -80,7 +80,7 @@ func (t *GenerateCoverTask) Start(ctx context.Context) {
}
// update the scene with the update date
_, err = qb.UpdatePartial(ctx, t.Scene.ID, updatedScene)
_, err = qb.UpdatePartial(ctx, t.Scene.ID, scenePartial)
if err != nil {
return fmt.Errorf("error updating scene: %v", err)
}