add user tags api

This commit is contained in:
pypy
2020-03-21 13:23:05 +09:00
parent 0e7a29da37
commit 5abb320019

View File

@@ -1118,6 +1118,44 @@ CefSharp.BindObjectAsync(
});
};
/*
params: {
tags: array[string]
}
*/
API.addUserTags = function (params) {
return this.call(`users/${this.currentUser.id}/addTags`, {
method: 'POST',
params
}).then((json) => {
var args = {
json,
params
};
this.$emit('USER:CURRENT:SAVE', args);
return args;
});
};
/*
params: {
tags: array[string]
}
*/
API.removeUserTags = function (params) {
return this.call(`users/${this.currentUser.id}/removeTags`, {
method: 'POST',
params
}).then((json) => {
var args = {
json,
params
};
this.$emit('USER:CURRENT:SAVE', args);
return args;
});
};
// API: World
API.cachedWorlds = new Map();