addings tags returns the created tag

This commit is contained in:
Miodec 2021-07-08 23:27:47 +01:00
parent fe834b52d0
commit c730d5fa44

View file

@ -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) {