mirror of
https://github.com/writefreely/writefreely
synced 2024-11-24 09:33:11 +00:00
Use standard SetCollectionAttribute method for saving email sub settings
This commit is contained in:
parent
ac40b2f733
commit
d1afa44a2e
1 changed files with 2 additions and 2 deletions
|
@ -977,7 +977,7 @@ func (db *datastore) UpdateCollection(app *App, c *SubmittedCollection, alias st
|
||||||
// Update EmailSub value
|
// Update EmailSub value
|
||||||
if c.EmailSubs {
|
if c.EmailSubs {
|
||||||
// TODO: ensure these work with SQLite
|
// TODO: ensure these work with SQLite
|
||||||
_, err = db.Exec("INSERT INTO collectionattributes (collection_id, attribute, value) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE value = ?", collID, "email_subs", "1", "1")
|
err = db.SetCollectionAttribute(collID, "email_subs", "1")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Unable to insert email_subs value: %v", err)
|
log.Error("Unable to insert email_subs value: %v", err)
|
||||||
return err
|
return err
|
||||||
|
@ -994,7 +994,7 @@ func (db *datastore) UpdateCollection(app *App, c *SubmittedCollection, alias st
|
||||||
skipUpdate = true
|
skipUpdate = true
|
||||||
}
|
}
|
||||||
if !skipUpdate {
|
if !skipUpdate {
|
||||||
_, err = db.Exec("INSERT INTO collectionattributes (collection_id, attribute, value) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE value = ?", collID, collAttrLetterReplyTo, *c.LetterReply, *c.LetterReply)
|
err = db.SetCollectionAttribute(collID, collAttrLetterReplyTo, *c.LetterReply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Unable to insert %s value: %v", collAttrLetterReplyTo, err)
|
log.Error("Unable to insert %s value: %v", collAttrLetterReplyTo, err)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue