Skip to content

Commit

Permalink
fixed broken date editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Sep 11, 2024
1 parent eb55a4e commit e950198
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion handler/htmx/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ func RecordDateIssued(c echo.Context, db *sql.DB) error {
}
y, m, d := form.ValidDate(year, month, day)
if !y || !m || !d {
return c.NoContent(http.StatusNoContent)
return badRequest(c, fmt.Errorf("%w, date failed to validate: Y %q %v ; M %q %v ; D %q %v ",
ErrFormat, year, y, month, m, day, d))
}
if err := model.UpdateDateIssued(db, int64(id), year, month, day); err != nil {
return badRequest(c, err)
Expand Down
2 changes: 0 additions & 2 deletions model/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"database/sql"
"fmt"
"net/url"
"os"
"time"

"github.com/Defacto2/server/handler/pouet"
Expand Down Expand Up @@ -107,7 +106,6 @@ func InsertUpload(ctx context.Context, tx *sql.Tx, values url.Values, key string
if err != nil {
return 0, noID, fmt.Errorf("upload: %w", err)
}
fmt.Fprintf(os.Stderr, "\ninsert upload f.Insert: %+v\n", f)
if err = f.Insert(ctx, tx, boil.Infer()); err != nil {
return 0, noID, fmt.Errorf("insert upload key %q: %w", key, err)
}
Expand Down
2 changes: 1 addition & 1 deletion view/app/artifactedit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ aria-labelledby="artifact-delete-forever-modal-label" aria-hidden="true">
hx-patch="/editor/date"
hx-include="[name='artifact-editor-key'],
[name='artifact-editor-year'],
[name='artifact-editor-year-resetter']
[name='artifact-editor-year-resetter'],
[name='artifact-editor-month'],
[name='artifact-editor-day']">Save</button>
</div>
Expand Down

0 comments on commit e950198

Please sign in to comment.