Merge branch 'main' of https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir into fuhrmanator/issue79

This commit is contained in:
C. Fuhrman 2024-09-24 14:25:35 -04:00
commit 9091a1a44f
2 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@ class Folders {
const existingFolder = await foldersCollection.findOne({ title: title, userId: userId }); const existingFolder = await foldersCollection.findOne({ title: title, userId: userId });
if (existingFolder) return null; if (existingFolder) return new Error('Folder already exists');
const newFolder = { const newFolder = {
userId: userId, userId: userId,
@ -171,4 +171,4 @@ class Folders {
} }
module.exports = new Folders; module.exports = new Folders;

View file

@ -40,7 +40,7 @@ class Users {
await userCollection.insertOne(newUser); await userCollection.insertOne(newUser);
const folderTitle = 'Dossier par Défaut'; const folderTitle = 'Dossier par Défaut';
const userId = newUser._id; const userId = newUser._id.toString();
await Folders.create(folderTitle, userId); await Folders.create(folderTitle, userId);
// TODO: verif if inserted properly... // TODO: verif if inserted properly...
@ -118,4 +118,4 @@ class Users {
} }
module.exports = new Users; module.exports = new Users;