Do not use pointer to point when retrieving tags to edit
It is the same with go 16, but with Debian’s go 15 it fails and I believe, but i am not sure, this is the reason.
This commit is contained in:
parent
19f81128ec
commit
27a266097a
|
@ -414,7 +414,7 @@ func ServeEditContactTags(w http.ResponseWriter, r *http.Request, params httprou
|
||||||
company := getCompany(r)
|
company := getCompany(r)
|
||||||
slug := params[0].Value
|
slug := params[0].Value
|
||||||
form := newTagsForm(companyURI(company, "/contacts/"+slug+"/tags"), slug, locale)
|
form := newTagsForm(companyURI(company, "/contacts/"+slug+"/tags"), slug, locale)
|
||||||
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from contact where slug = $1`, form.Slug).Scan(&form.Tags)) {
|
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from contact where slug = $1`, form.Slug).Scan(form.Tags)) {
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,7 +397,7 @@ func ServeEditExpenseTags(w http.ResponseWriter, r *http.Request, params httprou
|
||||||
company := getCompany(r)
|
company := getCompany(r)
|
||||||
slug := params[0].Value
|
slug := params[0].Value
|
||||||
form := newTagsForm(companyURI(company, "/expenses/"+slug+"/tags"), slug, locale)
|
form := newTagsForm(companyURI(company, "/expenses/"+slug+"/tags"), slug, locale)
|
||||||
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from expense where slug = $1`, form.Slug).Scan(&form.Tags)) {
|
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from expense where slug = $1`, form.Slug).Scan(form.Tags)) {
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -1066,7 +1066,7 @@ func ServeEditInvoiceTags(w http.ResponseWriter, r *http.Request, params httprou
|
||||||
company := getCompany(r)
|
company := getCompany(r)
|
||||||
slug := params[0].Value
|
slug := params[0].Value
|
||||||
form := newTagsForm(companyURI(company, "/invoices/"+slug+"/tags"), slug, locale)
|
form := newTagsForm(companyURI(company, "/invoices/"+slug+"/tags"), slug, locale)
|
||||||
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from invoice where slug = $1`, form.Slug).Scan(&form.Tags)) {
|
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from invoice where slug = $1`, form.Slug).Scan(form.Tags)) {
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -359,7 +359,7 @@ func ServeEditProductTags(w http.ResponseWriter, r *http.Request, params httprou
|
||||||
company := getCompany(r)
|
company := getCompany(r)
|
||||||
slug := params[0].Value
|
slug := params[0].Value
|
||||||
form := newTagsForm(companyURI(company, "/products/"+slug+"/tags"), slug, locale)
|
form := newTagsForm(companyURI(company, "/products/"+slug+"/tags"), slug, locale)
|
||||||
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from product where slug = $1`, form.Slug).Scan(&form.Tags)) {
|
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from product where slug = $1`, form.Slug).Scan(form.Tags)) {
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue