Skip to content

Commit

Permalink
trying to fix shit but still fixing nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloose committed Dec 2, 2024
1 parent 65bbc23 commit c9d7e2a
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions stiller-backend/internal/handlers/post_gallery.new.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,27 @@ func PostGalleryNew(w http.ResponseWriter, r *http.Request, params httprouter.Pa
return
}

template_data, template_data_err := templates.GetTemplateData(req_payload.Template)
if loggers.RequestLog(template_data_err, "", http.StatusInternalServerError, &w) {
templateFileId := int(-1)
templateFileQuery_stmt := sqlf.Select("templatefile").
From("template").
Where("id = ?", req_payload.Template)

templateFileQuery_query, templateFileQuery_args := templateFileQuery_stmt.String(), templateFileQuery_stmt.Args()

templateFileQuery_err := sqlitex.ExecuteTransient(dbconn, templateFileQuery_query, &sqlitex.ExecOptions{
ResultFunc: func(stmt *sqlite.Stmt) error {
templateFileId = int(stmt.GetInt64("templatefile"))
return nil
},
Args: templateFileQuery_args,
})

if loggers.RequestLog(templateFileQuery_err, "", http.StatusInternalServerError, &w) {
return
}

template_data, template_data_err := templates.GetTemplateData(templateFileId)
if loggers.RequestLog(template_data_err, "Error gettint template id", http.StatusInternalServerError, &w) {
return
}

Expand Down

0 comments on commit c9d7e2a

Please sign in to comment.