Skip to content

Commit

Permalink
fix(InMemoryProvider): updateGuild and updateAxon return values (#49)
Browse files Browse the repository at this point in the history
* Fix JsonProvider jsdoc

* Return type consistency
  • Loading branch information
bsian03 authored Feb 16, 2020
1 parent 169905b commit a88dda2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/Database/InMemoryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,15 @@ class InMemoryProvider extends ADBProvider {
async updateGuild(key, gID, value) {
const guild = await this.fetchGuild(gID);
guild[key] = value;
return this.saveGuild(gID, guild);
this.axon.guildConfigs.set(gID, guild);
return true;
}

async updateAxon(key, value) {
let axonConf = this.axon.axonConfig;
if (!axonConf) {
axonConf = await this.initAxon();
}
const axonConf = await this.fetchAxon();
axonConf[key] = value;
return this.saveAxon(axonConf);
this.axon.axonConfig = axonConf;
return true;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Database/JsonProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class JsonProvider extends ADBProvider {
*
* @param {String} key - The identifier in the Database
* @param {Object|Array|String|Boolean} value - The value to update in the DB
* @returns {Promise<Boolean>} Whether the request was successfull or not
* @returns {Promise<Boolean>} Whether the request was successful or not
* @memberof JsonProvider
*/
async updateAxon(key, value) {
Expand All @@ -105,7 +105,7 @@ class JsonProvider extends ADBProvider {
* @param {String} key - The identifier in the Database
* @param {String} gID - The guild ID to update
* @param {Object|Array|String|Boolean} value - The value to update in the DB
* @returns {Promise<Boolean>} Whether the request was successfull or not
* @returns {Promise<Boolean>} Whether the request was successful or not
* @memberof JsonProvider
*/
async updateGuild(key, gID, value) {
Expand Down

0 comments on commit a88dda2

Please sign in to comment.