feat (restful): Add /api/utils/refresh

The API call does the following:
- Fetch GitHub avatar and update artifact store url
- Revoke all cached resources
This commit is contained in:
Peng-YM
2022-07-11 23:06:40 +08:00
parent 6881148021
commit 2c4e47166d
8 changed files with 37 additions and 14 deletions

View File

@@ -28,7 +28,7 @@ async function updateSettings(req, res) {
success(res, newSettings);
}
async function updateGitHubAvatar() {
export async function updateGitHubAvatar() {
const settings = $.read(SETTINGS_KEY);
const username = settings.githubUser;
if (username) {
@@ -50,7 +50,7 @@ async function updateGitHubAvatar() {
}
}
async function updateArtifactStore() {
export async function updateArtifactStore() {
$.log('Updating artifact store');
const settings = $.read(SETTINGS_KEY);
const { githubUser, gistToken } = settings;