From 5abb320019ae5fdd3a11265299f8437abed25ce2 Mon Sep 17 00:00:00 2001 From: pypy Date: Sat, 21 Mar 2020 13:23:05 +0900 Subject: [PATCH] add user tags api --- html/app.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/html/app.js b/html/app.js index c73e2d77..dbcf731d 100644 --- a/html/app.js +++ b/html/app.js @@ -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();