From 4040e3b7209a6e9100f8d1d2e0ef02668d699b5b Mon Sep 17 00:00:00 2001 From: Code by Ben Date: Sat, 28 Sep 2024 08:32:00 +1000 Subject: [PATCH] attempt for ByForApproval fix. --- handler/app/internal/fileslice/fileslice.go | 2 +- model/artifacts.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/handler/app/internal/fileslice/fileslice.go b/handler/app/internal/fileslice/fileslice.go index dd6c715a..af1ca9b4 100644 --- a/handler/app/internal/fileslice/fileslice.go +++ b/handler/app/internal/fileslice/fileslice.go @@ -187,7 +187,7 @@ func FileInfo(uri string) (string, string, string) { lead = "These are the recent file artifacts that have been modified or submitted on Defacto2." case ForApproval: logo = "new uploads" - h1sub = "edit the new uploads" + h1sub = "edit the new uploads for approval" lead = "These are the recent file artifacts that have been submitted for approval on Defacto2." case Deletions: logo = "deletions" diff --git a/model/artifacts.go b/model/artifacts.go index 847c38d1..33c391dd 100644 --- a/model/artifacts.go +++ b/model/artifacts.go @@ -161,9 +161,9 @@ func (f *Artifacts) ByForApproval(ctx context.Context, exec boil.ContextExecutor } const clause = "id DESC" return models.Files( + qm.WithDeleted(), models.FileWhere.Deletedat.IsNotNull(), models.FileWhere.Deletedby.IsNull(), - qm.WithDeleted(), qm.OrderBy(clause), qm.Offset(calc(offset, limit)), qm.Limit(limit)).All(ctx, exec) @@ -173,13 +173,13 @@ func (f *Artifacts) byForApproval(ctx context.Context, exec boil.ContextExecutor if invalidExec(exec) { return ErrDB } - if f.Bytes > 0 && f.Count > 0 { - return nil - } + // if f.Bytes > 0 && f.Count > 0 { + // return nil + // } return models.NewQuery( + qm.WithDeleted(), models.FileWhere.Deletedat.IsNotNull(), models.FileWhere.Deletedby.IsNull(), - qm.WithDeleted(), qm.Select(postgres.Columns()...), qm.From(From)).Bind(ctx, exec, f) }