Skip to content

Commit

Permalink
Fix broken new submission insert.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Dec 2, 2023
1 parent dfa63f8 commit b63a452
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cmd/dictpress/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ func handleNewSubmission(c echo.Context) error {
fromID, err := app.data.InsertSubmissionEntry(e)
if err != nil {
app.lo.Printf("error inserting submission entry: %v", err)
return echo.NewHTTPError(http.StatusInternalServerError,
fmt.Sprintf("Error saving entry.", err))
return echo.NewHTTPError(http.StatusInternalServerError, "Error saving entry.")
}

// Insert relations.
Expand Down
5 changes: 3 additions & 2 deletions queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ old AS (
LIMIT 1
),
e AS (
INSERT INTO entries (content, initial, weight, tokens, lang, tags, phones, notes, status)
INSERT INTO entries (content, initial, weight, tokens, lang, tags, phones, notes, meta, status)
SELECT
$1,
$2,
Expand All @@ -220,7 +220,8 @@ e AS (
$7,
$8,
$9,
$10
$10,
$11
WHERE NOT EXISTS (SELECT * FROM old)
RETURNING id
)
Expand Down

0 comments on commit b63a452

Please sign in to comment.