Added site setting.

This commit is contained in:
Leon Mika 2025-02-02 09:54:30 +11:00
parent 39611070f8
commit 3774c903e2
17 changed files with 170 additions and 18 deletions

View file

@ -76,3 +76,28 @@ func (q *Queries) NewSite(ctx context.Context, arg NewSiteParams) (int64, error)
err := row.Scan(&id)
return id, err
}
const updateSite = `-- name: UpdateSite :exec
UPDATE sites SET
name = $2,
title = $3,
theme = $4
WHERE id = $1
`
type UpdateSiteParams struct {
ID int64
Name string
Title string
Theme string
}
func (q *Queries) UpdateSite(ctx context.Context, arg UpdateSiteParams) error {
_, err := q.db.Exec(ctx, updateSite,
arg.ID,
arg.Name,
arg.Title,
arg.Theme,
)
return err
}