Skip to content
Snippets Groups Projects
Commit 1ab02580 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Create method in settings to update options of one setting

parent 0c352577
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,19 @@ RocketChat.settings.updateById = (_id, value) ->
return RocketChat.models.Settings.updateValueById _id, value
###
# Update options of a setting by id
# @param {String} _id
###
RocketChat.settings.updateOptionsById = (_id, options) ->
# console.log '[functions] RocketChat.settings.updateOptionsById -> '.green, 'arguments:', arguments
if not _id or not options?
return false
return RocketChat.models.Settings.updateOptionsById _id, options
###
# Update a setting by id
# @param {String} _id
......
......@@ -37,6 +37,16 @@ RocketChat.models.Settings = new class extends RocketChat.models._Base
return @update query, update
updateOptionsById: (_id, options) ->
query =
_id: _id
update =
$set: options
return @update query, update
# REMOVE
createWithIdAndValue: (_id, value) ->
record =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment