diff --git a/studywell-backend/task-functions.js b/studywell-backend/task-functions.js index c7e7e25..da9e579 100644 --- a/studywell-backend/task-functions.js +++ b/studywell-backend/task-functions.js @@ -4,45 +4,25 @@ import taskModel from "./task.js"; // const dotenv = require('dotenv'); dotenv.config(); -<<<<<<< HEAD -======= let count = 0; ->>>>>>> backend mongoose.set("debug", true); mongoose .connect( "mongodb+srv://" + -<<<<<<< HEAD - /* eslint-disable-next-line no-undef*/ process.env.MONGO_USER + ":" + - /* eslint-disable-next-line no-undef*/ process.env.MONGO_PWD + "@" + - /* eslint-disable-next-line no-undef*/ process.env.MONGO_CLUSTER + "/" + - /* eslint-disable-next-line no-undef*/ -======= - process.env.MONGO_USER + - ":" + - process.env.MONGO_PWD + - "@" + - process.env.MONGO_CLUSTER + - "/" + ->>>>>>> backend process.env.MONGO_DB + "?retryWrites=true&w=majority", { useNewUrlParser: true, //useFindAndModify: false, useUnifiedTopology: true, -<<<<<<< HEAD - }, -======= } ->>>>>>> backend ) .catch((error) => console.log(error)); @@ -51,28 +31,12 @@ function getTasks(description) { if (description === undefined) { promise = taskModel.find(); } -<<<<<<< HEAD - console.log(promise); -======= - // console.log(promise); ->>>>>>> backend return promise; } function addTasks(task) { const taskToAdd = new taskModel(task); const promise = taskToAdd.save(); -<<<<<<< HEAD - console.log(promise); - return promise; -} - -function findTaskID(id) { - return taskModel.find({ id: id }); -} -function deleteUser(id) { - return taskModel.findByIdAndDelete(id); -======= //console.log(promise); return promise; } @@ -89,15 +53,10 @@ async function deleteUser(id) { console.error(error); throw error; // Rethrow the error to handle it in the calling function } ->>>>>>> backend } export default { getTasks, addTasks, -<<<<<<< HEAD - findTaskID, -======= findTaskIndex, ->>>>>>> backend deleteUser, };