implement contact us

This commit is contained in:
2024-10-24 10:15:45 -05:00
parent 13568d00b5
commit b112c726bb
7 changed files with 99 additions and 2 deletions

View File

@@ -452,6 +452,26 @@ func (d *SqliteDB) GetSvgStringInterface(idxs SvgIdInterface) ([]string, error)
return d.getSvgsById(idxs)
}
func (d *SqliteDB) WriteNewContactUsForm(userId UserId, form ContactFormPost) error {
query := `
INSERT INTO contact_us (
name
,message
,company_name
,alternate_email
,user_id
,created_at
)
VALUES (?,?,?,?,?,?)
`
args := []any{
form.Name, form.Message, form.CompanyName, form.AlternateEmail, uuid.UUID(userId), timeStamp(),
}
return d.addWriteTx(query, args)
return nil
}
func (d *SqliteDB) getSvgsById(ids []int) ([]string, error) {
tx, err := d.db.Begin()
if err != nil {