mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-11 22:23:32 +08:00
addings tags returns the created tag
This commit is contained in:
parent
fe834b52d0
commit
c730d5fa44
1 changed files with 7 additions and 2 deletions
|
@ -53,9 +53,14 @@ class UsersDAO {
|
|||
}
|
||||
|
||||
static async addTag(uid, name) {
|
||||
return await mongoDB()
|
||||
let id = uuid.v4();
|
||||
await mongoDB()
|
||||
.collection("users")
|
||||
.updateOne({ uid }, { $push: { tags: { id: uuid.v4(), name } } });
|
||||
.updateOne({ uid }, { $push: { tags: { id, name } } });
|
||||
return {
|
||||
id,
|
||||
name,
|
||||
};
|
||||
}
|
||||
|
||||
static async getTags(uid) {
|
||||
|
|
Loading…
Reference in a new issue