comnpany to cm

This commit is contained in:
ctengiz
2024-06-14 17:19:38 +03:00
parent a28576960e
commit f54c5660ea
15 changed files with 50 additions and 74 deletions

View File

@@ -19,7 +19,7 @@ func tmplPost(w http.ResponseWriter, r *http.Request) {
return
}
sq := "update company set tmpl = $2 where id = $1"
sq := "update cm set tmpl = $2 where id = $1"
_, err = dbu.DB.Exec(r.Context(), sq, companyID, body)
if err != nil {
mhttp.InternalServerError(w, err)
@@ -33,7 +33,7 @@ func tmplGet(w http.ResponseWriter, r *http.Request) {
companyID := cmn.StrToInt64(chi.URLParam(r, "companyID"))
var body json.RawMessage
sq := "select tmpl from company where id = $1"
sq := "select tmpl from cm where id = $1"
err := dbu.DB.QueryRow(r.Context(), sq, companyID).Scan(&body)
if err != nil {
mhttp.InternalServerError(w, err)