Added options for setting the site targets

This commit is contained in:
Leon Mika 2025-02-03 21:13:25 +11:00
parent a31c8e48ce
commit cb45f6aa53
5 changed files with 74 additions and 21 deletions

View file

@ -94,3 +94,21 @@ func (q *Queries) ListTargetsOfSite(ctx context.Context, siteID int64) ([]Publis
}
return items, nil
}
const updatePublishTarget = `-- name: UpdatePublishTarget :exec
UPDATE publish_targets SET
url = $2,
target_ref = $3
WHERE id = $1
`
type UpdatePublishTargetParams struct {
ID int64
Url string
TargetRef string
}
func (q *Queries) UpdatePublishTarget(ctx context.Context, arg UpdatePublishTargetParams) error {
_, err := q.db.Exec(ctx, updatePublishTarget, arg.ID, arg.Url, arg.TargetRef)
return err
}