From c730d5fa44b0f12b828f10a11dbbbe3ec04aa5fe Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 8 Jul 2021 23:27:47 +0100 Subject: [PATCH] addings tags returns the created tag --- backend/dao/user.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/dao/user.js b/backend/dao/user.js index d9395512c..abfa6c645 100644 --- a/backend/dao/user.js +++ b/backend/dao/user.js @@ -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) {