-
-
Save Ciaanh/331a6dd9535a8a5ffc5efb7853fa7485 to your computer and use it in GitHub Desktop.
Hosthub-step-3-config-loadDbFile.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadDbFile() { | |
var githubApi = new GithubAPi("ciaanh", "hosthub", "db"); | |
githubApi.get(this.db_name, (err, res) => { | |
if (res === null || res === undefined || res === "") { | |
res = { | |
description: "Config description", | |
name: "my config", | |
users: [] | |
}; | |
} | |
let newState = { ...this.state }; | |
newState.config = { | |
path: this.db_name, | |
data: res.content | |
}; | |
this.setState(newState); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment