1
mirror of https://gitlab.com/commento/commento.git synced 2025-06-29 22:56:37 -04:00

frontend,api: open source comment sticky

This commit is contained in:
Adhityaa Chandrasekar
2018-12-18 18:57:32 -05:00
parent cf0b394b05
commit 610b61831d
6 changed files with 88 additions and 11 deletions

View File

@ -13,12 +13,12 @@ func pageUpdate(p page) error {
// commentCount
statement := `
INSERT INTO
pages (domain, path, isLocked)
VALUES ($1, $2, $3 )
pages (domain, path, isLocked, stickyCommentHex)
VALUES ($1, $2, $3, $4 )
ON CONFLICT (domain, path) DO
UPDATE SET isLocked = $3;
UPDATE SET isLocked = $3, stickyCommentHex = $4;
`
_, err := db.Exec(statement, p.Domain, p.Path, p.IsLocked)
_, err := db.Exec(statement, p.Domain, p.Path, p.IsLocked, p.StickyCommentHex)
if err != nil {
logger.Errorf("error setting page attributes: %v", err)
return errorInternal