diff --git a/app.js b/app.js index 8447e3a..46e57ec 100644 --- a/app.js +++ b/app.js @@ -23,35 +23,5 @@ app.use(fileUpload({ //auth import user from "./routes/userRoute.js" app.use("/api/v1/", user); -//category -import category from "./routes/categoryRoute.js" -app.use("/api", category); -//directory -import directory from "./routes/directoryRoute.js" -app.use("/api", directory); -//News -import news from "./routes/newsRoute.js" -app.use("/api", news); -//Events -import Event from "./routes/EventsRoute.js" -app.use("/api", Event); -//Offers -import Offer from "./routes/OffersRoute.js" -app.use("/api", Offer); -//banner -import banner from "./routes/bannerRoute.js" -app.use("/api", banner); -//cmp-Ristriction -import cmpRistriction from "./routes/cmp-restriction-Route.js" -app.use("/api", cmpRistriction); -//feedback -import feedback from "./routes/feedbackRoute.js" -app.use("/api", feedback); -//requirement -import requirement from "./routes/RequirementRoute.js" -app.use("/api", requirement); -//requirement -import faqs from "./routes/FaqsRoute.js" -app.use("/api", faqs); export default app; \ No newline at end of file diff --git a/controllers/EventsController.js b/controllers/EventsController.js deleted file mode 100644 index d55e443..0000000 --- a/controllers/EventsController.js +++ /dev/null @@ -1,269 +0,0 @@ -import Events from "../models/EventsModel.js" -import cloudinary from "cloudinary"; -import { ResisterUserModel } from "../models/EventsModel.js" -// import cloudinary from "../Utils/cloudinary.js" -//import { v2 as cloudinary } from 'cloudinary' - -export const createEvent = async (req, res) => { - - try { - // console.log(req.body) - const files = req.files.image; - - // console.log(files) - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "cmp/image", - }, - function (error, result) { (result, error) }); - const { title, location, description, date, time } = req.body; - - const data = await Events.create({ - title, - image: { - public_id: myCloud.public_id, - url: myCloud.secure_url, - }, - location, - description, - date, - time, - addedBy: req.user.id - - }); - res.status(201).json({ - success: true, - msg: " create Event Successfully!!", - data, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to create Event !!" - }); - } - -}; -//get All Event -export const getAllEvent = async (req, res) => { - - try { - const Event = await Events.find(); - // console.log(category) - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - Event, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; -//get One Event -export const getOneEvent = async (req, res) => { - - try { - const Event = await Events.findById(req.params.id); - // console.log(category) - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - Event, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -// 3.update Event -export const updateEvent = async (req, res) => { - try { - const newEventData = { - title: req.body.title, - description: req.body.description, - location: req.body.location, - date: req.body.date, - time: req.body.time, - }; - - - if (req.files) { - const files = req.files.image; - const getEvent = await Events.findById(req.params.id); - - const imageId = getEvent.image.public_id; - // console.log(imageId) - //delete image from claudinary - await cloudinary.uploader.destroy(imageId) - // await cloudinary.uploader.destroy(imageId, function (result) { console.log(result) }); - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "image", - }, - function (error, result) { (result, error) }); - // console.log(myCloud) - newEventData.image = { - public_id: myCloud.public_id, - url: myCloud.secure_url, - }; - } - // console.log(newCategoryData) - //req.user.id, - const ModifyEvent = await Events.findByIdAndUpdate(req.params.id, newEventData, - - { new: true } - // runValidators: true, - // useFindAndModify: false, - ); - - res.status(200).json({ - success: true, - ModifyEvent - }); - - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to UpDate Event!!" - - }); - } - -}; - -//delete one Event -export const deleteEvent = async (req, res) => { - - try { - //delete image from cloudinary - const getEvent = await Events.findById(req.params.id); - // console.log(categ) - const imageId = getEvent.image.public_id; - await cloudinary.uploader.destroy(imageId) - - //-------------------------// - const event = await Events.findByIdAndDelete(req.params.id) - if (!event) { - return res.status(404).json({ message: 'Event Not Found' }); - } - await event.remove(); - res.status(200).json({ - success: true, - msg: "Event Deleted Successfully!!", - // category, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to Delete event !!" - }); - } - -}; - - -//EventRegisterUser - -export const RegisterUserInEvent = async (req, res) => { - try { - const totalUserRegister = await ResisterUserModel.findOne({ - userId: req.user.id, - eventId: req.params.id, - }) - if (totalUserRegister) { - - return res.status(200).json({ - success: false, - msg: "You Have Already Registered for this Event" - }); - } - const Event = await ResisterUserModel.create({ - eventId: req.params.id, - userId: req.user.id, - - }) - res.status(201).json({ - success: true, - msg: " Register Successfully!!", - Event, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to Register !!" - }); - } -} -//getAllRegisterUser -export const getAllRegisterUser = async (req, res) => { - try { - const totalUserRegister = await ResisterUserModel.find({ eventId: req.params.id }).count() - const user = await ResisterUserModel.find({ eventId: req.params.id }).populate('userId') - res.status(200).json({ - success: true, - msg: " get All user Register in Event Successfully!!", - totalUserRegister, - user, - }); - } catch (error) { - console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } -} -//getSingleRegisterUser -export const getSingleRegisterUser = async (req, res) => { - try { - - const user = await ResisterUserModel.findById(req.params.id).populate('userId'). - - res.status(200).json({ - success: true, - msg: " get Successfully!!", - user, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } -} - - -//share app (api) -export const shareApp = async (req, res) => { - - try { - if (!process.env.APP_STORE_URL) { - return res.status(404).json({ - success: false, - msg: "App URl not Found" - }); - } - res.status(200).json({ - success: true, - AppUrl: `${process.env.APP_STORE_URL}`, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; diff --git a/controllers/FaqsController.js b/controllers/FaqsController.js deleted file mode 100644 index b44ad8a..0000000 --- a/controllers/FaqsController.js +++ /dev/null @@ -1,162 +0,0 @@ -import FaqsModel from "../models/FaqsModel.js"; -import cloudinary from "cloudinary"; -// import cloudinary from "../Utils/cloudinary.js" -//import { v2 as cloudinary } from 'cloudinary' - -export const createFaqs = async (req, res) => { - - try { - // const files = req.files.image; - - // console.log(files.tempFilePath) - // const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - // folder: "cmp/News", - // }, - // function (error, result) { (result, error) }); - const { topic, description } = req.body; - - const Faqs = await FaqsModel.create({ - topic, - // image: { - // public_id: myCloud.public_id, - // url: myCloud.secure_url, - // }, - description, - - }); - res.status(201).json({ - success: true, - msg: " create Faqs Successfully!!", - Faqs, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to create !!" - }); - } - -}; -//get All Faqs -export const getAllFaqs = async (req, res) => { - - try { - const Faqs = await FaqsModel.find(); - // console.log(news) - res.status(200).json({ - success: true, - msg: " fetch Faqs Successfully!!", - Faqs, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; -//get One news -export const getOneFaqs = async (req, res) => { - - try { - const Faqs = await FaqsModel.findById(req.params.id); - // console.log(news) - res.status(200).json({ - success: true, - msg: " fetch Faqs Successfully!!", - Faqs, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -// 3.update Faqs -export const updateFaqs = async (req, res) => { - try { - const newFaqsData = { - topic: req.body.topic, - description: req.body.description, - }; - //console.log(req.files) - - // if (req.files) { - // const files = req.files.image; - - // const newsImage = await FaqsModel.findById(req.params.id); - - // const imgId = newsImage.image.public_id; - - // //delete image from claudinary - // await cloudinary.uploader.destroy(imgId) - // // await cloudinary.uploader.destroy(imageId, function (result) { console.log(result) }); - // const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - // folder: "cmp/image", - // }, - // function (error, result) { (result, error) }); - // // console.log(myCloud) - // newFaqsData.image = { - // public_id: myCloud.public_id, - // url: myCloud.secure_url, - // }; - // } - // console.log(newFaqsData) - //req.user.id, - const ModifyFaqs = await FaqsModel.findByIdAndUpdate(req.params.id, newFaqsData, - - { new: true } - // runValidators: true, - // useFindAndModify: false, - ); - - res.status(200).json({ - success: true, - ModifyFaqs - }); - - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to UpDate !!" - - }); - } - -}; - -//delete one Faqs -export const deleteOneFaqs = async (req, res) => { - - try { - //delete image from cloudinary - // const findFaqs = await FaqsModel.findById(req.params.id); - // // console.log(newsImageId) - // const imgId = findFaqs.image.public_id; - // await cloudinary.uploader.destroy(imgId) - - //-------------------------// - const Faqs = await FaqsModel.findByIdAndDelete(req.params.id) - if (!Faqs) { - return res.status(400).json({ message: 'Faqs Not Found' }); - } - await Faqs.remove(); - res.status(200).json({ - success: true, - msg: "Faqs Deleted Successfully!!", - // Faqs, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to Delete !!" - }); - } - -}; diff --git a/controllers/NewsController.js b/controllers/NewsController.js deleted file mode 100644 index 8f40925..0000000 --- a/controllers/NewsController.js +++ /dev/null @@ -1,162 +0,0 @@ -import News from "../models/newsModel.js" -import cloudinary from "cloudinary"; -// import cloudinary from "../Utils/cloudinary.js" -//import { v2 as cloudinary } from 'cloudinary' - -export const createNews = async (req, res) => { - - try { - const files = req.files.image; - - // console.log(files.tempFilePath) - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "cmp/News", - }, - function (error, result) { (result, error) }); - const { title, description } = req.body; - - const news = await News.create({ - title, - image: { - public_id: myCloud.public_id, - url: myCloud.secure_url, - }, - description, - - }); - res.status(201).json({ - success: true, - msg: " create News Successfully!!", - news, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to create !!" - }); - } - -}; -//get All news -export const getAllNews = async (req, res) => { - - try { - const news = await News.find(); - // console.log(news) - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - news, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; -//get One news -export const getOneNews = async (req, res) => { - - try { - const news = await News.findById(req.params.id); - // console.log(news) - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - news, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -// 3.update news -export const updateNews = async (req, res) => { - try { - const newNewsData = { - title: req.body.title, - description: req.body.description, - }; - //console.log(req.files) - - if (req.files) { - const files = req.files.image; - - const newsImage = await News.findById(req.params.id); - - const imgId = newsImage.image.public_id; - - //delete image from claudinary - await cloudinary.uploader.destroy(imgId) - // await cloudinary.uploader.destroy(imageId, function (result) { console.log(result) }); - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "cmp/image", - }, - function (error, result) { (result, error) }); - // console.log(myCloud) - newNewsData.image = { - public_id: myCloud.public_id, - url: myCloud.secure_url, - }; - } - console.log(newNewsData) - //req.user.id, - const ModifyNews = await News.findByIdAndUpdate(req.params.id, newNewsData, - - { new: true } - // runValidators: true, - // useFindAndModify: false, - ); - - res.status(200).json({ - success: true, - ModifyNews - }); - - } catch (error) { - console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to UpDate !!" - - }); - } - -}; - -//delete one news -export const deleteOneNews = async (req, res) => { - - try { - //delete image from cloudinary - const findNews = await News.findById(req.params.id); - // console.log(newsImageId) - const imgId = findNews.image.public_id; - await cloudinary.uploader.destroy(imgId) - - //-------------------------// - const news = await News.findByIdAndDelete(req.params.id) - if (!news) { - return res.status(400).json({ message: 'News Not Found' }); - } - await news.remove(); - res.status(200).json({ - success: true, - msg: "News Deleted Successfully!!", - // news, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to Delete !!" - }); - } - -}; diff --git a/controllers/OffersController.js b/controllers/OffersController.js deleted file mode 100644 index 22eaced..0000000 --- a/controllers/OffersController.js +++ /dev/null @@ -1,157 +0,0 @@ -import Offers from "../models/OffersModel.js" -import cloudinary from "cloudinary"; - -export const createOffer = async (req, res) => { - - try { - //console.log(req.body) - const files = req.files.image; - - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "cmp/image", - }, - function (error, result) { (result, error) }); - const { title, location, description, bisunessName } = req.body; - - const data = await Offers.create({ - title, - image: { - public_id: myCloud.public_id, - url: myCloud.secure_url, - }, - location, - description, - bisunessName - - }); - res.status(201).json({ - success: true, - msg: " create Offer Successfully!!", - data, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to create Offer !!" - }); - } - -}; -//get All Product -export const getAllOffer = async (req, res) => { - - try { - const offer = await Offers.find(); - res.status(200).json({ - success: true, - msg: " fetch All Offer Successfully!!", - offer, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; -//get One Product -export const getOneOffer = async (req, res) => { - - try { - const offer = await Offers.findById(req.params.id); - - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - offer, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -// 3.update offer -export const updateOffer = async (req, res) => { - try { - const newOfferData = { - title: req.body.title, - description: req.body.description, - location: req.body.location, - bisunessName: req.body.bisunessName - }; - - - if (req.files) { - const files = req.files.image; - const getOffer = await Offers.findById(req.params.id); - - const imageId = getOffer.image.public_id; - - await cloudinary.uploader.destroy(imageId) - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "image", - }, - function (error, result) { (result, error) }); - newOfferData.image = { - public_id: myCloud.public_id, - url: myCloud.secure_url, - }; - } - - //req.user.id, - const ModifyOffer = await Offers.findByIdAndUpdate(req.params.id, newOfferData, - - { new: true } - - ); - - res.status(200).json({ - success: true, - ModifyOffer - }); - - } catch (error) { - console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to UpDate Offer!!" - - }); - } - -}; - -//delete one category -export const deleteOffer = async (req, res) => { - - try { - //delete image from cloudinary - const getOffer = await Offers.findById(req.params.id); - // console.log(categ) - const imageId = getOffer.image.public_id; - await cloudinary.uploader.destroy(imageId) - - //-------------------------// - const offer = await Offers.findByIdAndDelete(req.params.id) - if (!offer) { - return res.status(400).json({ message: 'Offer Not Found' }); - } - await offer.remove(); - res.status(200).json({ - success: true, - msg: "Offer Deleted Successfully!!", - // category, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to Delete Offer !!" - }); - } - -}; diff --git a/controllers/RequirementController.js b/controllers/RequirementController.js deleted file mode 100644 index 2632107..0000000 --- a/controllers/RequirementController.js +++ /dev/null @@ -1,305 +0,0 @@ -import RequirementModel from "../models/RequirementModel.js" -import cloudinary from "cloudinary"; -import { RequirementCommentModel } from "../models/RequirementModel.js"; -// import cloudinary from "../Utils/cloudinary.js" -//import { v2 as cloudinary } from 'cloudinary' - -export const createRequirement = async (req, res) => { - - try { - let images = []; - let Allfiles = req.files.image; - // console.log(typeof Allfiles.tempFilePath) - if (typeof Allfiles.tempFilePath === "string") { - let filepath = Allfiles.tempFilePath; - - images.push(filepath) - } else { - Allfiles.map(item => { - images.push(item.tempFilePath); - }) - } - - const imagesLinks = []; - for (let i = 0; i < images.length; i++) { - const result = await cloudinary.v2.uploader.upload(images[i], { - folder: "cmp", - }); - - imagesLinks.push({ - public_id: result.public_id, - url: result.secure_url, - }); - } - - - req.body.image = imagesLinks; - req.body.addedBy = req.user.id; - - - // if (req.user.role === "admin"){ - // req.body.approved=true - // } - // else{ - // req.body.approved = false - // } - req.body.approved = (req.user.role === "admin" ? true : false); - - - const Requirement = await RequirementModel.create(req.body); - res.status(201).json({ - success: true, - msg: " create Requirement Successfully!!", - Requirement, - }); - } catch (error) { - // console.log(error) - res.status(400).json({ - success: false, - msg: "Failled to create !!" - }); - } - -}; -//get All Requirement -export const getAllRequirement = async (req, res) => { - - try { - if (req.user.role === "admin") { - const Requirement = await RequirementModel.find(); - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - Requirement, - }); - } - else { - const Requirement = await RequirementModel.find({ approved: true }); - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - Requirement, - }); - } - - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; -//get One Requirement -export const getOneRequirement = async (req, res) => { - - try { - const Requirement = await RequirementModel.findById(req.params.id); - // console.log(news) - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - Requirement, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -// 3.update Requirement -export const updateRequirement = async (req, res) => { - try { - const Requirement = await RequirementModel.findById(req.params.id); - if (!Requirement) { - return res.status(400).json({ message: 'Requirement Not Found' }); - } - //handle image------------------------------------------------------------ - let images = []; - let Allfiles = req.files.image; - // console.log(typeof Allfiles.tempFilePath) - if (typeof Allfiles.tempFilePath === "string") { - let filepath = Allfiles.tempFilePath; - // console.log(filepath) - images.push(filepath) - } else { - Allfiles.map(item => { - images.push(item.tempFilePath); - }) - } - - - if (images !== undefined) { - // Deleting Images From Cloudinary - for (let i = 0; i < Requirement.image.length; i++) { - await cloudinary.v2.uploader.destroy(Requirement.image[i].public_id); - } - - const imagesLinks = []; - - for (let i = 0; i < images.length; i++) { - const result = await cloudinary.v2.uploader.upload(images[i], { - folder: "cmp", - }); - - imagesLinks.push({ - public_id: result.public_id, - url: result.secure_url, - }); - } - - req.body.image = imagesLinks; - } - // ------------------------------------------------------------------------ - - const ModifyRequirement = await RequirementModel.findByIdAndUpdate(req.params.id, req.body, - - { - new: true, - runValidators: true, - useFindAndModify: false - } - - ); - - res.status(200).json({ - success: true, - ModifyRequirement - }); - - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to UpDate !!" - - }); - } - -}; - -//delete one Requirement -export const deleteOneRequirement = async (req, res) => { - - try { - const findRequirement = await RequirementModel.findById(req.params.id); - - if (!findRequirement) { - return res.status(400).json({ message: 'Requirement Not Found' }); - } - // Deleting Images From Cloudinary - for (let i = 0; i < findRequirement.image.length; i++) { - await cloudinary.v2.uploader.destroy(findRequirement.image[i].public_id); - } - - - await findRequirement.remove(); - res.status(200).json({ - success: true, - msg: "Requirement Deleted Successfully!!", - // news, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to Delete !!" - }); - } - -}; - - -// -//Approved(admin) -export const Approved = async (req, res) => { - - try { - const Requirement = await RequirementModel.findById(req.params.id); - if (Requirement.approved === false) { - Requirement.approved = true - Requirement.save() - } else { - res.status(500).json({ - success: false, - msg: " already Approved", - }); - } - res.status(200).json({ - success: true, - msg: " Approved Successfully!!", - Requirement, - }); - } catch (error) { - console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to Approved !!" - }); - } - -}; -//comment - -export const AddComment = async (req, res) => { - try { - - const comment = await RequirementCommentModel.create({ - requirementId: req.params.id, - userId: req.user._id, - comment: req.body.comment - - }) - res.status(201).json({ - success: true, - msg: " Create Successfully!!", - comment, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to create !!" - }); - } -} -//get All Comment -export const getAllComment = async (req, res) => { - try { - - const comment = await RequirementCommentModel.find().populate('userId') - res.status(200).json({ - success: true, - msg: " get All Comment Successfully!!", - comment, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } -} -//get Comment -export const getSingleComment = async (req, res) => { - try { - - const comment = await RequirementCommentModel.findById(req.params.id).populate('userId'). - - res.status(200).json({ - success: true, - msg: " get Comment Successfully!!", - comment, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } -} \ No newline at end of file diff --git a/controllers/bannerController.js b/controllers/bannerController.js deleted file mode 100644 index 42c469c..0000000 --- a/controllers/bannerController.js +++ /dev/null @@ -1,172 +0,0 @@ -import Banners from "../models/bannerModel.js" -import cloudinary from "cloudinary"; -// import cloudinary from "../Utils/cloudinary.js" -//import { v2 as cloudinary } from 'cloudinary' - -export const createBanner = async (req, res) => { - - try { - const files = req.files.image; - // console.log(files) - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "cmp/image", - }, - function (error, result) { (result, error) }); - - const { title, startDate, endDate } = req.body; - const data = await Banners.create({ - title, - // subTitle, - image: { - public_id: myCloud.public_id, - url: myCloud.secure_url, - }, - // section, - startDate, - endDate, - // subSection - - }); - - res.status(201).json({ - success: true, - msg: " create Banner Successfully!!", - data, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to create Banner !!" - }); - } - -}; -//get All Banners -export const getAllBanner = async (req, res) => { - - try { - const banner = await Banners.find(); - // console.log(category) - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - banner, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; -//get One Banner -export const getOneBanner = async (req, res) => { - - try { - const banner = await Banners.findById(req.params.id); - // console.log(category) - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - banner, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -// 3.update Event -export const updateBanner = async (req, res) => { - try { - - const newBannerData = { - title: req.body.title, - // subTitle: req.body.subTitle, - - // section: req.body.section, - // subSection: req.body.subSection, - startDate: req.body.startDate, - endDate: req.body.endDate, - }; - - - if (req.files) { - const files = req.files.image; - const getBanner = await Banners.findById(req.params.id); - - const imageId = getBanner.image.public_id; - // console.log(imageId) - //delete image from claudinary - await cloudinary.uploader.destroy(imageId) - // await cloudinary.uploader.destroy(imageId, function (result) { console.log(result) }); - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "image", - }, - function (error, result) { (result, error) }); - // console.log(myCloud) - newBannerData.image = { - public_id: myCloud.public_id, - url: myCloud.secure_url, - }; - } - - //req.user.id, - const ModifyBanner = await Banners.findByIdAndUpdate(req.params.id, newBannerData, - - { new: true } - // runValidators: true, - // useFindAndModify: false, - ); - - res.status(200).json({ - success: true, - ModifyBanner - }); - - } catch (error) { - console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to UpDate Banner!!" - - }); - } - -}; - -//delete one Banner -export const deleteBanner = async (req, res) => { - - try { - //delete image from cloudinary - const getBanner = await Banners.findById(req.params.id); - // console.log(categ) - const imageId = getBanner.image.public_id; - await cloudinary.uploader.destroy(imageId) - - //-------------------------// - const banner = await Banners.findByIdAndDelete(req.params.id) - if (!banner) { - return res.status(400).json({ message: 'banner Not Found' }); - } - await banner.remove(); - res.status(200).json({ - success: true, - msg: "banner Deleted Successfully!!", - // category, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to Delete banner !!" - }); - } - -}; diff --git a/controllers/categoryController.js b/controllers/categoryController.js deleted file mode 100644 index 5afbfa7..0000000 --- a/controllers/categoryController.js +++ /dev/null @@ -1,193 +0,0 @@ -import Category from "../models/categoryModel.js" -import cloudinary from "cloudinary"; - - -export const createCategory = async (req, res) => { - - try { - const files = req.files; - - // ctegory upload - const myCloud = await cloudinary.uploader.upload(files.image.tempFilePath, { - folder: "cmp/image", - }, - function (error, result) { (result, error) }); - - // ctegory(banner)upload - const CategoryBanner = await cloudinary.uploader.upload(files.category_banner.tempFilePath, { - folder: "cmp/image", - }, - function (error, result) { (result, error) }); - const { name } = req.body; - - const data = await Category.create({ - name, - image: { - public_id: myCloud.public_id, - url: myCloud.secure_url, - }, - category_banner: { - public_id: CategoryBanner.public_id, - url: CategoryBanner.secure_url, - }, - - }); - res.status(201).json({ - success: true, - msg: " create Category Successfully!!", - data, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to create !!" - }); - } - -}; -//get All Product -export const getAllCategory = async (req, res) => { - - try { - const category = await Category.find().sort({ createdAt: -1 }); - - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - category, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; -//get One Product -export const getOneCategory = async (req, res) => { - - try { - const category = await Category.findById(req.params.id); - - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - category, - }); - } catch (error) { - - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -// 3.update Category -export const updateCategory = async (req, res) => { - try { - const newCategoryData = { - name: req.body.name, - }; - - - if (req.files) { - - const categ = await Category.findById(req.params.id); - if (req.files.image) { - const imageId = categ.image.public_id; - - //delete image from claudinary - await cloudinary.uploader.destroy(imageId) - const files = req.files.image; - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "image", - }, - function (error, result) { (result, error) }); - newCategoryData.image = { - public_id: myCloud.public_id, - url: myCloud.secure_url, - }; - } - if (req.files.category_banner) { - - const BannerImageId = categ.category_banner.public_id; - - //delete image from claudinary - await cloudinary.uploader.destroy(BannerImageId) - - - const files = req.files.category_banner; - const BannerImage = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "image", - }, - function (error, result) { (result, error) }); - newCategoryData.category_banner = { - public_id: BannerImage.public_id, - url: BannerImage.secure_url, - }; - } - } - - - const ModifyCategory = await Category.findByIdAndUpdate(req.params.id, newCategoryData, - - { new: true } - // runValidators: true, - // useFindAndModify: false, - ); - - res.status(200).json({ - success: true, - ModifyCategory - }); - - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to UpDate !!" - - }); - } - -}; - -//delete one category -export const deleteOneCategory = async (req, res) => { - - try { - //delete image from cloudinary - const categ = await Category.findById(req.params.id); - if (categ.category_banner.public_id) { - const bannerImageId = categ.category_banner.public_id; - await cloudinary.uploader.destroy(bannerImageId) - - } - - // console.log(categ) - const imageId = categ.image.public_id; - await cloudinary.uploader.destroy(imageId) - - //-------------------------// - const category = await Category.findByIdAndDelete(req.params.id) - if (!category) { - return res.status(400).json({ message: 'category Not Found' }); - } - await category.remove(); - res.status(200).json({ - success: true, - msg: "category Deleted Successfully!!", - // category, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to Delete !!" - }); - } - -}; diff --git a/controllers/cmp-restriction-Controller.js b/controllers/cmp-restriction-Controller.js deleted file mode 100644 index 12e80db..0000000 --- a/controllers/cmp-restriction-Controller.js +++ /dev/null @@ -1,166 +0,0 @@ -import cmpRestrictionModel from "../models/cmp-restriction-model.js" -import cloudinary from "cloudinary"; -export const createRestriction = async (req, res) => { - - try { - - const CMSData = { - title: req.body.title, - page_data: req.body.page_data, - }; - - if (req.files) { - const files = req.files.image; - - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "cmp/image", - }, - function (error, result) { (result, error) }); - CMSData.image = { - public_id: myCloud.public_id, - url: myCloud.url, - } - - } - - const data = await cmpRestrictionModel.create( - CMSData - ); - res.status(201).json({ - success: true, - msg: " create Restriction Successfully!!", - data, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to create Restriction !!" - }); - } - -}; -//get All -export const getAllRestriction = async (req, res) => { - - try { - const CmpRestriction = await cmpRestrictionModel.find(); - // console.log(news) - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - CmpRestriction, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -//get One -export const getOneRestriction = async (req, res) => { - - try { - const CmpRestriction = await cmpRestrictionModel.findById(req.params.id); - - res.status(200).json({ - success: true, - msg: " fetch Restriction Successfully!!", - CmpRestriction, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -// 3.update -export const updateRestriction = async (req, res) => { - try { - if (!req.params.id) { - return res.status(404).json({ - msg: "CMS Id Not Found!" - }); - } - const CMSData = { - title: req.body.title, - page_data: req.body.page_data, - }; - if (req.files) { - const getCms = await cmpRestrictionModel.findById(req.params.id); - //delete from cloudinary - if (getCms.image.public_id) { - const imageId = getCms.image.public_id; - await cloudinary.uploader.destroy(imageId) - } - const files = req.files.image; - - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "cmp/image", - }, - function (error, result) { (result, error) }); - CMSData.image = { - public_id: myCloud.public_id, - url: myCloud.url, - } - - } - - - const ModifyCms = await cmpRestrictionModel.findByIdAndUpdate(req.params.id, CMSData, - { new: true } - ); - res.status(200).json({ - success: true, - ModifyCms - }); - - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to UpDate !!" - - }); - } - -}; - -//delete -export const deleteCms = async (req, res) => { - - try { - //delete image from cloudinary - const getCms = await cmpRestrictionModel.findById(req.params.id); - - if (getCms.image.public_id) { - const imageId = getCms.image.public_id; - await cloudinary.uploader.destroy(imageId) - } - - //-------------------------// - const Cms = await cmpRestrictionModel.findByIdAndDelete(req.params.id) - if (!Cms) { - return res.status(400).json({ message: 'CMS Not Found' }); - } - await Cms.remove(); - res.status(200).json({ - success: true, - msg: "CMS Deleted Successfully!!", - - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to Delete !!" - }); - } - -}; - diff --git a/controllers/directoryController.js b/controllers/directoryController.js deleted file mode 100644 index 1f4de05..0000000 --- a/controllers/directoryController.js +++ /dev/null @@ -1,248 +0,0 @@ -import directoryModel from "../models/directoryModel.js"; -import cloudinary from "cloudinary"; -export const createDirectory = async (req, res) => { - - try { - let images; - if (req.files) { - const files = req.files.image; - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "cmp/image", - }, - function (error, result) { (result, error) }); - images = { - public_id: myCloud.public_id, - url: myCloud.secure_url, - } - } - const { - name, - phone, - email, - Bname, - Sname, - country, - city, - description, - category, - status, - Glocation, - LinkedinUrl, - FacebookUrl, - InstagramUrl, - } = req.body; - const data = await directoryModel.create({ - - name, - phone, - email, - Building_Name: Bname, - Street_Name: Sname, - country, - city, - description, - category, - status, - Glocation, - LinkedinUrl, - FacebookUrl, - InstagramUrl, - image: images, - userId: req.user.id - - }); - res.status(201).json({ - success: true, - msg: " create Directory Successfully!!", - data, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to create !!" - }); - } - -}; -//get All Directory(User) -export const getAllDirectoryUser = async (req, res) => { - - try { - const directory = await directoryModel.find({ status: true }); - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - directory, - }); - } - catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -//get All Directory(admin) -export const getAllDirectory = async (req, res) => { - - try { - - const directory = await directoryModel.find(); - - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - directory, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; -//get One Directory -export const getOneDirectory = async (req, res) => { - - try { - const directory = await directoryModel.findById(req.params.id); - // console.log(directory.status) - // console.log(category) - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - directory, - }); - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - -export const updateDirectory = async (req, res) => { - try { - let images; - if (req.files) { - const files = req.files.image; - const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { - folder: "cmp/image", - }, - function (error, result) { (result, error) }); - images = { - public_id: myCloud.public_id, - url: myCloud.secure_url, - } - } - req.body.image = images; - const ModifyDirectory = await directoryModel.findByIdAndUpdate(req.params.id, req.body, - - { new: true } - // runValidators: true, - // useFindAndModify: false, - ); - - res.status(200).json({ - success: true, - ModifyDirectory - }); - - } catch (error) { - // console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to UpDate !!" - - }); - } - -}; -//delete one category -export const deleteOneDirectory = async (req, res) => { - - try { - //delete image from cloudinary(if image exist) - const dir = await directoryModel.findById(req.params.id); - // console.log(categ) - if (dir.image.public_id) { - const imageId = dir.image.public_id; - await cloudinary.uploader.destroy(imageId) - } - - const directory = await directoryModel.findByIdAndDelete(req.params.id) - if (!directory) { - return res.status(400).json({ message: 'Directory Not Found' }); - } - await directory.remove(); - res.status(200).json({ - success: true, - msg: "Directory Deleted Successfully!!", - // category, - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to Delete !!" - }); - } - -}; - -//get One Directory from userid -export const getSelfDirectory = async (req, res) => { - - try { - const directory = await directoryModel.find({ userId: req.user.id }); - - if (!directory) { - return res.status(400).json({ message: 'No self directory exist ' }); - } - res.status(200).json({ - success: true, - msg: " fetch Successfully!!", - directory, - }); - } catch (error) { - //console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; -export const setStatus = async (req, res) => { - try { - const id = req.params.id; - if (!id) return res.status(400).json({ message: 'id is required' }); - // console.log(id) - const directory = await directoryModel.findById(req.params.id) - - if (!directory) - return res - .status(404) - .json({ message: 'Did not find directory by given id' }); - if (directory.status === "true") { - directory.status = false - } - else { - directory.status = true - } - - directory.save(); - // console.log(directory) - res.status(200).json(directory); - } catch (error) { - // console.log(error); - res.status(500).json({ - message: error.message - }); - } -}; diff --git a/controllers/feedbackController.js b/controllers/feedbackController.js deleted file mode 100644 index 5a02309..0000000 --- a/controllers/feedbackController.js +++ /dev/null @@ -1,63 +0,0 @@ -import feedbackModel from "../models/feedbackModel.js" - -export const createFeedback = async (req, res) => { - try { - const { name, description } = req.body; - // req.body.user = req.user.id; - const feedback = await feedbackModel.create({ - name, - description, - user: req.user._id - }); - res.status(201).json({ - success: true, - msg: " create feedback Successfully!!", - feedback, - }); - } catch (error) { - console.log(error) - res.status(500).json({ - success: false, - msg: "Failled to create !!" - }); - } - -}; -//get All feedback -export const getAllFeedback = async (req, res) => { - - try { - const feedback = await feedbackModel.find(); - res.status(200).json({ - success: true, - msg: " fetch feedback Successfully!!", - feedback - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; -//get All feedback -export const getAOneFeedback = async (req, res) => { - - try { - const feedback = await feedbackModel.findById(req.params.id); - res.status(200).json({ - success: true, - msg: " fetch feedback Successfully!!", - feedback - }); - } catch (error) { - res.status(500).json({ - success: false, - msg: "Failled to fetch !!" - }); - } - -}; - - diff --git a/controllers/userController.js b/controllers/userController.js index f47ffb5..cc4e510 100644 --- a/controllers/userController.js +++ b/controllers/userController.js @@ -6,18 +6,24 @@ import sendToken from "../Utils/jwtToken.js" import sendEmail from "../Utils/sendEmail.js" import crypto from "crypto" import cloudinary from "cloudinary" -import generator from 'generate-password' import password from 'secure-random-password' // 1.Register a User export const registerUser = async (req, res, next) => { try { + const { name, email, password, phone } = req.body; + let findUser = await User.findOne({ email }) + if (findUser) { + return res + .status(400) + .json({ success: false, message: "User already exists" }); + } const files = req.files.avatar; const myCloud = await cloudinary.uploader.upload(files.tempFilePath, { folder: "cmp-user/image", }, function (error, result) { (result, error) }); - const { name, email, password, phone } = req.body; + const user = await User.create({ name, @@ -32,14 +38,9 @@ export const registerUser = async (req, res, next) => { sendToken(user, 201, res); } catch (e) { // console.log(e.message); - if (e.toString().includes('E11000 duplicate key error collection')) { - return res.status(400).json({ - status: 'User Already Exists' - }); - } return res .status(400) - .json({ status: 'Error Communicating with server' }); + .json({ success: false, message: e.message }); } }; @@ -66,11 +67,7 @@ export const loginUser = catchAsyncErrors(async (req, res, next) => { if (!isPasswordMatched) { return res.status(400).json({ message: 'Invalid Email or Password' }); } - // const token = user.getJWTToken(); - // res.status(201).json({ - // success: true, - // token, - // }) + sendToken(user, 200, res); }); @@ -130,7 +127,7 @@ export const forgotPassword = catchAsyncErrors(async (req, res, next) => { from: `${process.env.SEND_EMAIL_FROM}`, // Change to your verified sender - subject: `CMP Password Recovery`, + subject: `ATP Password Recovery`, html: `your new password is:
${passwords}

If you have not requested this email then, please ignore it.` }); diff --git a/middlewares/auth.js b/middlewares/auth.js index ad44410..ee69600 100644 --- a/middlewares/auth.js +++ b/middlewares/auth.js @@ -19,7 +19,7 @@ export const isAuthenticatedUser = async (req, res, next) => { const frontdecoded = jwt.verify(fronttoken, process.env.JWT_SECRET); if (!frontdecoded) { - return res.status(200).json({ + return res.status(400).json({ success: false, message: "incorrect token", }); diff --git a/models/EventsModel.js b/models/EventsModel.js deleted file mode 100644 index ff0cfae..0000000 --- a/models/EventsModel.js +++ /dev/null @@ -1,67 +0,0 @@ -import mongoose from "mongoose" -const eventSchema = new mongoose.Schema( - { - title: { - type: String, - required: true - }, - image: - { - public_id: { - type: String, - required: true, - }, - url: { - type: String, - required: true, - }, - }, - date: { - type: Date, - required: true - }, - time: { - type: String, - required: true - }, - location: { - type: String, - required: true - }, - description: { - type: String, - required: true - }, - addedBy: { - type: mongoose.Schema.ObjectId, - ref: "User", - required: true, - }, - addedOn: { - type: Date, - default: Date.now - }, - - }, { timestamps: true } -); -const eventModel = mongoose.model("event", eventSchema); -export default eventModel - -const ResisterUserSchema = new mongoose.Schema( - { - - eventId: { - type: String, - required: true - }, - userId: { - type: mongoose.Schema.ObjectId, - ref: "User", - required: true, - }, - - - }, { timestamps: true } -); -const ResisterUserModel = mongoose.model("RegisterUserInEvent", ResisterUserSchema); -export { ResisterUserModel } \ No newline at end of file diff --git a/models/FaqsModel.js b/models/FaqsModel.js deleted file mode 100644 index 9fa6c91..0000000 --- a/models/FaqsModel.js +++ /dev/null @@ -1,26 +0,0 @@ -import mongoose from "mongoose" -const faqsSchema = new mongoose.Schema( - { - topic: { - type: String, - required: true - }, - // image: - // { - // public_id: { - // type: String, - // required: true, - // }, - // url: { - // type: String, - // required: true, - // }, - // }, - description: { - type: String, - required: true - }, - }, { timestamps: true } -); -const FaqsModel = mongoose.model("Faqs", faqsSchema); -export default FaqsModel; \ No newline at end of file diff --git a/models/OffersModel.js b/models/OffersModel.js deleted file mode 100644 index baa08ee..0000000 --- a/models/OffersModel.js +++ /dev/null @@ -1,39 +0,0 @@ -import mongoose from "mongoose" -const offerSchema = new mongoose.Schema( - { - title: { - type: String, - required: true - }, - image: - { - public_id: { - type: String, - required: true, - }, - url: { - type: String, - required: true, - }, - }, - bisunessName: { - type: String, - required: true - }, - location: { - type: String, - required: true - }, - description: { - type: String, - required: true - }, - addedOn: { - type: Date, - default: Date.now - }, - - }, { timestamps: true } -); -const offerModel = mongoose.model("offer", offerSchema); -export default offerModel \ No newline at end of file diff --git a/models/RequirementModel.js b/models/RequirementModel.js deleted file mode 100644 index e75252c..0000000 --- a/models/RequirementModel.js +++ /dev/null @@ -1,70 +0,0 @@ -import mongoose from "mongoose" -const RequirementSchema = new mongoose.Schema( - { - title: { - type: String, - required: true - }, - areaOfInterest: { - type: String, - required: true - }, - - image: [ - { - public_id: { - type: String, - required: true, - }, - url: { - type: String, - required: true, - }, - }, - ], - - description: { - type: String, - required: true - }, - - addedBy: { - type: mongoose.Schema.ObjectId, - ref: "User", - required: true, - }, - approved: { - type: Boolean, - default: false, - }, - - }, { timestamps: true } -); -const RequirementModel = mongoose.model("Requirement", RequirementSchema); -export default RequirementModel; - - -const RequirementCommentSchema = new mongoose.Schema( - { - - requirementId: { - type: String, - required: true - }, - - comment: { - type: String, - required: true - }, - - userId: { - type: mongoose.Schema.ObjectId, - ref: "User", - required: true, - }, - - - }, { timestamps: true } -); -const RequirementCommentModel = mongoose.model("RequirementComment", RequirementCommentSchema); -export { RequirementCommentModel }; \ No newline at end of file diff --git a/models/bannerModel.js b/models/bannerModel.js deleted file mode 100644 index cd6d4f1..0000000 --- a/models/bannerModel.js +++ /dev/null @@ -1,47 +0,0 @@ -import mongoose from "mongoose" -const bannerSchema = new mongoose.Schema( - { - title: { - type: String, - required: true - }, - // subTitle: { - // type: String, - // required: true - // }, - image: - { - public_id: { - type: String, - required: true, - }, - url: { - type: String, - required: true, - }, - }, - // section: { - // type: String, - - // }, - // subSection: { - // type: String, - // }, - - startDate: { - type: Date, - required: true - }, - endDate: { - type: Date, - required: true - }, - addedOn: { - type: Date, - default: Date.now - }, - - }, { timestamps: true } -); -const bannerModel = mongoose.model("banner", bannerSchema); -export default bannerModel \ No newline at end of file diff --git a/models/categoryModel.js b/models/categoryModel.js deleted file mode 100644 index 5f95360..0000000 --- a/models/categoryModel.js +++ /dev/null @@ -1,38 +0,0 @@ -import mongoose from "mongoose" -const categorySchema = new mongoose.Schema( - { - name: { - type: String, - required: true - }, - image: - { - public_id: { - type: String, - required: true, - }, - url: { - type: String, - required: true, - }, - }, - category_banner: - { - public_id: { - type: String, - // required: true, - }, - url: { - type: String, - // required: true, - }, - }, - addedOn: { - type: Date, - default: Date.now - }, - - }, { timestamps: true } -); -const categoryUpload = mongoose.model("category", categorySchema); -export default categoryUpload; \ No newline at end of file diff --git a/models/cmp-restriction-model.js b/models/cmp-restriction-model.js deleted file mode 100644 index 9259d55..0000000 --- a/models/cmp-restriction-model.js +++ /dev/null @@ -1,29 +0,0 @@ -import mongoose from "mongoose" -const cmpRisSchema = new mongoose.Schema( - { - title: { - type: String, - required: true - }, - page_data: { - type: String, - required: true - }, - image: - { - public_id: { - type: String, - - }, - url: { - type: String, - - }, - }, - - - - }, { timestamps: true } -); -const cmpRisModel = mongoose.model("cmp-res", cmpRisSchema); -export default cmpRisModel; \ No newline at end of file diff --git a/models/directoryModel.js b/models/directoryModel.js deleted file mode 100644 index f4837d3..0000000 --- a/models/directoryModel.js +++ /dev/null @@ -1,79 +0,0 @@ -import mongoose from "mongoose" -const directorySchema = new mongoose.Schema( - { - name: { - type: String, - required: true - }, - phone: { - type: Number, - required: true - }, - email: { - type: String, - required: true, - }, - image: - { - public_id: { - type: String, - // required: true, - }, - url: { - type: String, - // required: true, - }, - }, - Building_Name: { - type: String, - required: true - }, - Street_Name: { - type: String, - required: true - }, - country: { - type: String, - required: true - }, - city: { - type: String, - required: true - }, - description: { - type: String, - required: true - }, - category: { - type: String, - required: true - }, - status: { - type: String, - required: true - }, - Glocation: { - type: String, - - }, - LinkedinUrl: { - type: String, - - }, - FacebookUrl: { - type: String, - }, - InstagramUrl: { - type: String, - - }, - userId: { - type: mongoose.Schema.ObjectId, - ref: "User", - // required: true, - }, - - }, { timestamps: true } -); -const directoryModel = mongoose.model("directory", directorySchema); -export default directoryModel; \ No newline at end of file diff --git a/models/feedbackModel.js b/models/feedbackModel.js deleted file mode 100644 index 337ae53..0000000 --- a/models/feedbackModel.js +++ /dev/null @@ -1,20 +0,0 @@ -import mongoose from "mongoose" -const feedbackSchema = new mongoose.Schema( - { - name: { - type: String, - required: true - }, - description: { - type: String, - required: true - }, - user: { - type: mongoose.Schema.ObjectId, - ref: "User", - required: true, - }, - }, { timestamps: true } -); -const feedbackModel = mongoose.model("feedback", feedbackSchema); -export default feedbackModel \ No newline at end of file diff --git a/models/newsModel.js b/models/newsModel.js deleted file mode 100644 index 8d02c39..0000000 --- a/models/newsModel.js +++ /dev/null @@ -1,31 +0,0 @@ -import mongoose from "mongoose" -const newsSchema = new mongoose.Schema( - { - title: { - type: String, - required: true - }, - image: - { - public_id: { - type: String, - required: true, - }, - url: { - type: String, - required: true, - }, - }, - description: { - type: String, - required: true - }, - addedOn: { - type: Date, - default: Date.now - }, - - }, { timestamps: true } -); -const newsUpload = mongoose.model("news", newsSchema); -export default newsUpload; \ No newline at end of file diff --git a/models/userModel.js b/models/userModel.js index 98310b1..e96e1fd 100644 --- a/models/userModel.js +++ b/models/userModel.js @@ -21,7 +21,7 @@ const userSchema = new mongoose.Schema({ }, phone: { type: Number, - required: [true, "Please Enter Your phone no."], + // required: [true, "Please Enter Your phone no."], maxLength: [12, "phone cannot exceed 12 characters"], minLength: [6, "phone should have more than 6 characters"], }, diff --git a/package-lock.json b/package-lock.json index b5a13ce..793d7e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "dashboard-backend", + "name": "atp-backend", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "dashboard-backend", + "name": "atp-backend", "version": "1.0.0", "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 3bac299..1546c9e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "dashboard-backend", + "name": "atp-backend", "version": "1.0.0", "description": "", "main": "server.js", diff --git a/routes/EventsRoute.js b/routes/EventsRoute.js deleted file mode 100644 index 65b6d3c..0000000 --- a/routes/EventsRoute.js +++ /dev/null @@ -1,27 +0,0 @@ -import express from "express"; -import { - createEvent, - getAllEvent, - updateEvent, - deleteEvent, - getOneEvent, - RegisterUserInEvent, - getAllRegisterUser, - getSingleRegisterUser, - shareApp - -} from "../controllers/EventsController.js" -const router = express.Router(); -import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" -router.route("/event/create/").post(isAuthenticatedUser, authorizeRoles("admin"), createEvent) -router.route("/event/getAll/").get(getAllEvent) -router.route("/event/getOne/:id").get(getOneEvent) -router.route("/event/update/:id").put(isAuthenticatedUser, authorizeRoles("admin"), updateEvent); -router.route("/event/delete/:id").delete(isAuthenticatedUser, authorizeRoles("admin"), deleteEvent); -//share app -router.route("/app/share/").get(shareApp) -//user -router.route("/event/user/register/:id").post(isAuthenticatedUser, RegisterUserInEvent) -router.route("/event/admin/registerUser/getAll/:id").get(isAuthenticatedUser, getAllRegisterUser) -router.route("/event/getOne/registerUser/:id").get(isAuthenticatedUser, getSingleRegisterUser) -export default router; \ No newline at end of file diff --git a/routes/FaqsRoute.js b/routes/FaqsRoute.js deleted file mode 100644 index da26b63..0000000 --- a/routes/FaqsRoute.js +++ /dev/null @@ -1,16 +0,0 @@ -import express from "express"; -import { - createFaqs, - getAllFaqs, - getOneFaqs, - updateFaqs, - deleteOneFaqs -} from "../controllers/FaqsController.js" -const router = express.Router(); -import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" -router.route("/faqs/create/").post(isAuthenticatedUser, createFaqs) -router.route("/faqs/getAll/").get(isAuthenticatedUser, getAllFaqs) -router.route("/faqs/getOne/:id").get(isAuthenticatedUser, getOneFaqs) -router.route("/faqs/update/:id").put(isAuthenticatedUser, updateFaqs); -router.route("/faqs/delete/:id").delete(isAuthenticatedUser, deleteOneFaqs); -export default router; \ No newline at end of file diff --git a/routes/OffersRoute.js b/routes/OffersRoute.js deleted file mode 100644 index 4bc286f..0000000 --- a/routes/OffersRoute.js +++ /dev/null @@ -1,17 +0,0 @@ -import express from "express"; -import { - createOffer, - getAllOffer, - updateOffer, - deleteOffer, - getOneOffer -} from "../controllers/OffersController.js" -const router = express.Router(); -import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" - -router.route("/offer/create/").post(isAuthenticatedUser, authorizeRoles("admin"), createOffer)//isAuthenticatedUser, authorizeRoles("admin"), -router.route("/offer/getAll/").get(getAllOffer) -router.route("/offer/getOne/:id").get(getOneOffer) -router.route("/offer/update/:id").put(isAuthenticatedUser, authorizeRoles("admin"), updateOffer);//isAuthenticatedUser, authorizeRoles("admin"), -router.route("/offer/delete/:id").delete(isAuthenticatedUser, authorizeRoles("admin"), deleteOffer);//isAuthenticatedUser, authorizeRoles("admin"), -export default router; \ No newline at end of file diff --git a/routes/RequirementRoute.js b/routes/RequirementRoute.js deleted file mode 100644 index 8b4adc9..0000000 --- a/routes/RequirementRoute.js +++ /dev/null @@ -1,28 +0,0 @@ -import express from "express"; -import { - createRequirement, - getAllRequirement, - getOneRequirement, - updateRequirement, - deleteOneRequirement, - Approved, - AddComment, - getAllComment, - getSingleComment -} from "../controllers/RequirementController.js" -import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" -const router = express.Router(); - -router.route("/requirement/create/").post(isAuthenticatedUser, createRequirement) -router.route("/requirement/getAll/").get(isAuthenticatedUser, getAllRequirement) -router.route("/requirement/getOne/:id").get(isAuthenticatedUser, getOneRequirement) -router.route("/requirement/update/:id").put(isAuthenticatedUser, updateRequirement); -router.route("/requirement/delete/:id").delete(isAuthenticatedUser, deleteOneRequirement); -//user -router.route("/requirement/comment/create/:id").post(isAuthenticatedUser, AddComment); - -//admin -router.route("/admin/requirement/approve/:id").get(isAuthenticatedUser, authorizeRoles("admin"), Approved); -router.route("/admin/requirement/comment/getOne/:id").get(isAuthenticatedUser, getSingleComment); -router.route("/admin/requirement/comment/getAll").get(isAuthenticatedUser, getAllComment); -export default router; \ No newline at end of file diff --git a/routes/bannerRoute.js b/routes/bannerRoute.js deleted file mode 100644 index 044d86e..0000000 --- a/routes/bannerRoute.js +++ /dev/null @@ -1,16 +0,0 @@ -import express from "express"; -import { - createBanner, - getAllBanner, - updateBanner, - deleteBanner, - getOneBanner -} from "../controllers/bannerController.js" -const router = express.Router(); -import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" -router.route("/banner/create/").post(isAuthenticatedUser, authorizeRoles("admin"), createBanner) -router.route("/banner/getAll/").get(getAllBanner) -router.route("/banner/getOne/:id").get(getOneBanner) -router.route("/banner/update/:id").put(isAuthenticatedUser, authorizeRoles("admin"), updateBanner); -router.route("/banner/delete/:id").delete(isAuthenticatedUser, authorizeRoles("admin"), deleteBanner); -export default router; \ No newline at end of file diff --git a/routes/categoryRoute.js b/routes/categoryRoute.js deleted file mode 100644 index 500a40b..0000000 --- a/routes/categoryRoute.js +++ /dev/null @@ -1,17 +0,0 @@ -import express from "express"; -import { - createCategory, - getAllCategory, - updateCategory, - deleteOneCategory, - getOneCategory -} from "../controllers/categoryController.js" -const router = express.Router(); -import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" - -router.route("/category/create/").post(isAuthenticatedUser, authorizeRoles("admin"), createCategory) -router.route("/category/getAll/").get(getAllCategory) -router.route("/category/getOne/:id").get(getOneCategory) -router.route("/category/update/:id").put(isAuthenticatedUser, authorizeRoles("admin"), updateCategory); -router.route("/category/delete/:id").delete(isAuthenticatedUser, authorizeRoles("admin"), deleteOneCategory); -export default router; \ No newline at end of file diff --git a/routes/cmp-restriction-Route.js b/routes/cmp-restriction-Route.js deleted file mode 100644 index 4658cd5..0000000 --- a/routes/cmp-restriction-Route.js +++ /dev/null @@ -1,21 +0,0 @@ -import express from "express"; -import { - createRestriction, - getAllRestriction, - updateRestriction, - getOneRestriction, - deleteCms -} from "../controllers/cmp-restriction-Controller.js" -const router = express.Router(); - -import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" -router.route("/restriction/cms/create/").post(isAuthenticatedUser, authorizeRoles('admin'), createRestriction) - -router.route("/restriction/getAll").get(getAllRestriction) -router.route("/restriction/getOne/:id").get(getOneRestriction) -router.route("/restriction/cms/update/:id").put(isAuthenticatedUser, authorizeRoles('admin'), updateRestriction); -router.route("/restriction/cms/delete/:id").delete(isAuthenticatedUser, authorizeRoles('admin'), deleteCms); - - -export default router; -getAllRestriction \ No newline at end of file diff --git a/routes/directoryRoute.js b/routes/directoryRoute.js deleted file mode 100644 index bf5b2b3..0000000 --- a/routes/directoryRoute.js +++ /dev/null @@ -1,42 +0,0 @@ -import express from "express"; -import { - createDirectory, - getAllDirectory, - updateDirectory, - deleteOneDirectory, - getOneDirectory, - getSelfDirectory, - setStatus, - getAllDirectoryUser - -} from "../controllers/directoryController.js" -const router = express.Router(); -import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" - - -import multer from 'multer' - -const uploaderImage = multer({ - storage: multer.diskStorage({}), - fileFilter: (req, file, cb) => { - let ext = path.extname(file.originalname); - if (ext !== ".jpg" && ext !== ".jpeg" && ext !== ".png") { - cb(new Error("File type not supported!"), false) - return - } - cb(null, true); - } -}); -router.route("/directory/create/").post(isAuthenticatedUser, createDirectory) - -router.route("/directory/user/getAll/").get(getAllDirectoryUser) -router.route("/directory/getAll/").get(isAuthenticatedUser, authorizeRoles('admin'), getAllDirectory) -router.route("/directory/getOne/:id").get(getOneDirectory) -router.route("/directory/update/:id").put(isAuthenticatedUser, updateDirectory); -router.route("/directory/delete/:id").delete(isAuthenticatedUser, deleteOneDirectory); -//get Directory from user id -router.route("/directory/self/").get(isAuthenticatedUser, getSelfDirectory); -router.route("/directory/admin/setStatus/:id").get(isAuthenticatedUser, authorizeRoles('admin'), setStatus); - - -export default router; \ No newline at end of file diff --git a/routes/feedbackRoute.js b/routes/feedbackRoute.js deleted file mode 100644 index 70633a3..0000000 --- a/routes/feedbackRoute.js +++ /dev/null @@ -1,13 +0,0 @@ -import express from "express"; -import { - createFeedback, - getAllFeedback, - getAOneFeedback - -} from "../controllers/feedbackController.js" -const router = express.Router(); -import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" -router.route("/feedback/create/").post(isAuthenticatedUser, createFeedback) -router.route("/feedback/getAll/").get(isAuthenticatedUser, authorizeRoles('admin'), getAllFeedback) -router.route("/feedback/getOne/:id").get(isAuthenticatedUser, authorizeRoles('admin'), getAOneFeedback) -export default router; \ No newline at end of file diff --git a/routes/newsRoute.js b/routes/newsRoute.js deleted file mode 100644 index 6baeec9..0000000 --- a/routes/newsRoute.js +++ /dev/null @@ -1,17 +0,0 @@ -import express from "express"; -import { - createNews, - getAllNews, - getOneNews, - updateNews, - deleteOneNews -} from "../controllers/NewsController.js" -import { authorizeRoles, isAuthenticatedUser } from "../middlewares/auth.js"; -const router = express.Router(); - -router.route("/news/create/").post(isAuthenticatedUser, authorizeRoles("admin"), createNews) -router.route("/news/getAll/").get(getAllNews) -router.route("/news/getOne/:id").get(getOneNews) -router.route("/news/update/:id").put(isAuthenticatedUser, authorizeRoles("admin"), updateNews); -router.route("/news/delete/:id").delete(isAuthenticatedUser, authorizeRoles("admin"), deleteOneNews); -export default router; \ No newline at end of file diff --git a/tmp/tmp-1-1657787141122 b/tmp/tmp-1-1657787141122 deleted file mode 100644 index 62743be..0000000 Binary files a/tmp/tmp-1-1657787141122 and /dev/null differ diff --git a/tmp/tmp-1-1657789114165 b/tmp/tmp-1-1657789114165 deleted file mode 100644 index 25c7510..0000000 Binary files a/tmp/tmp-1-1657789114165 and /dev/null differ diff --git a/tmp/tmp-1-1657793260395 b/tmp/tmp-1-1657793260395 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-1-1657793260395 and /dev/null differ diff --git a/tmp/tmp-1-1657794453809 b/tmp/tmp-1-1657794453809 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-1-1657794453809 and /dev/null differ diff --git a/tmp/tmp-1-1657795000331 b/tmp/tmp-1-1657795000331 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-1-1657795000331 and /dev/null differ diff --git a/tmp/tmp-1-1657795664746 b/tmp/tmp-1-1657795664746 deleted file mode 100644 index 62743be..0000000 Binary files a/tmp/tmp-1-1657795664746 and /dev/null differ diff --git a/tmp/tmp-1-1657875807394 b/tmp/tmp-1-1657875807394 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-1-1657875807394 and /dev/null differ diff --git a/tmp/tmp-1-1657882389226 b/tmp/tmp-1-1657882389226 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-1-1657882389226 and /dev/null differ diff --git a/tmp/tmp-1-1657887651230 b/tmp/tmp-1-1657887651230 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-1-1657887651230 and /dev/null differ diff --git a/tmp/tmp-1-1658144371498 b/tmp/tmp-1-1658144371498 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-1-1658144371498 and /dev/null differ diff --git a/tmp/tmp-1-1658214653697 b/tmp/tmp-1-1658214653697 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-1-1658214653697 and /dev/null differ diff --git a/tmp/tmp-1-1658231137073 b/tmp/tmp-1-1658231137073 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-1-1658231137073 and /dev/null differ diff --git a/tmp/tmp-1-1658315722170 b/tmp/tmp-1-1658315722170 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-1-1658315722170 and /dev/null differ diff --git a/tmp/tmp-1-1658315928606 b/tmp/tmp-1-1658315928606 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-1-1658315928606 and /dev/null differ diff --git a/tmp/tmp-1-1658316073587 b/tmp/tmp-1-1658316073587 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-1-1658316073587 and /dev/null differ diff --git a/tmp/tmp-1-1658316799355 b/tmp/tmp-1-1658316799355 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-1-1658316799355 and /dev/null differ diff --git a/tmp/tmp-1-1658383347874 b/tmp/tmp-1-1658383347874 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-1-1658383347874 and /dev/null differ diff --git a/tmp/tmp-1-1659073689697 b/tmp/tmp-1-1659073689697 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-1-1659073689697 and /dev/null differ diff --git a/tmp/tmp-1-1659946125472 b/tmp/tmp-1-1659946125472 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-1-1659946125472 and /dev/null differ diff --git a/tmp/tmp-1-1659956023678 b/tmp/tmp-1-1659956023678 deleted file mode 100644 index 25c7510..0000000 Binary files a/tmp/tmp-1-1659956023678 and /dev/null differ diff --git a/tmp/tmp-1-1659959438596 b/tmp/tmp-1-1659959438596 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-1-1659959438596 and /dev/null differ diff --git a/tmp/tmp-1-1666076256102 b/tmp/tmp-1-1666076256102 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-1-1666076256102 and /dev/null differ diff --git a/tmp/tmp-1-1666848897487 b/tmp/tmp-1-1666848897487 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-1-1666848897487 and /dev/null differ diff --git a/tmp/tmp-1-1666850906209 b/tmp/tmp-1-1666850906209 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-1-1666850906209 and /dev/null differ diff --git a/tmp/tmp-1-1666851964376 b/tmp/tmp-1-1666851964376 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-1-1666851964376 and /dev/null differ diff --git a/tmp/tmp-2-1657787297134 b/tmp/tmp-2-1657787297134 deleted file mode 100644 index 62743be..0000000 Binary files a/tmp/tmp-2-1657787297134 and /dev/null differ diff --git a/tmp/tmp-2-1657793260430 b/tmp/tmp-2-1657793260430 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-2-1657793260430 and /dev/null differ diff --git a/tmp/tmp-2-1657794453817 b/tmp/tmp-2-1657794453817 deleted file mode 100644 index 25c7510..0000000 Binary files a/tmp/tmp-2-1657794453817 and /dev/null differ diff --git a/tmp/tmp-2-1657795664775 b/tmp/tmp-2-1657795664775 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-2-1657795664775 and /dev/null differ diff --git a/tmp/tmp-2-1657875868330 b/tmp/tmp-2-1657875868330 deleted file mode 100644 index 62743be..0000000 Binary files a/tmp/tmp-2-1657875868330 and /dev/null differ diff --git a/tmp/tmp-2-1657882389236 b/tmp/tmp-2-1657882389236 deleted file mode 100644 index 25c7510..0000000 Binary files a/tmp/tmp-2-1657882389236 and /dev/null differ diff --git a/tmp/tmp-2-1658315741266 b/tmp/tmp-2-1658315741266 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-2-1658315741266 and /dev/null differ diff --git a/tmp/tmp-2-1658317830552 b/tmp/tmp-2-1658317830552 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-2-1658317830552 and /dev/null differ diff --git a/tmp/tmp-2-1659946158121 b/tmp/tmp-2-1659946158121 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-2-1659946158121 and /dev/null differ diff --git a/tmp/tmp-2-1659959446590 b/tmp/tmp-2-1659959446590 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-2-1659959446590 and /dev/null differ diff --git a/tmp/tmp-2-1666848897531 b/tmp/tmp-2-1666848897531 deleted file mode 100644 index 25c7510..0000000 Binary files a/tmp/tmp-2-1666848897531 and /dev/null differ diff --git a/tmp/tmp-2-1666850932088 b/tmp/tmp-2-1666850932088 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-2-1666850932088 and /dev/null differ diff --git a/tmp/tmp-2-1666851964494 b/tmp/tmp-2-1666851964494 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-2-1666851964494 and /dev/null differ diff --git a/tmp/tmp-3-1657787334718 b/tmp/tmp-3-1657787334718 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-3-1657787334718 and /dev/null differ diff --git a/tmp/tmp-3-1657796738813 b/tmp/tmp-3-1657796738813 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-3-1657796738813 and /dev/null differ diff --git a/tmp/tmp-3-1657875943259 b/tmp/tmp-3-1657875943259 deleted file mode 100644 index 62743be..0000000 Binary files a/tmp/tmp-3-1657875943259 and /dev/null differ diff --git a/tmp/tmp-3-1657882483591 b/tmp/tmp-3-1657882483591 deleted file mode 100644 index 62743be..0000000 Binary files a/tmp/tmp-3-1657882483591 and /dev/null differ diff --git a/tmp/tmp-3-1658315841998 b/tmp/tmp-3-1658315841998 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-3-1658315841998 and /dev/null differ diff --git a/tmp/tmp-3-1659946272271 b/tmp/tmp-3-1659946272271 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-3-1659946272271 and /dev/null differ diff --git a/tmp/tmp-3-1659959454178 b/tmp/tmp-3-1659959454178 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-3-1659959454178 and /dev/null differ diff --git a/tmp/tmp-3-1666852001473 b/tmp/tmp-3-1666852001473 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-3-1666852001473 and /dev/null differ diff --git a/tmp/tmp-4-1657787334741 b/tmp/tmp-4-1657787334741 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-4-1657787334741 and /dev/null differ diff --git a/tmp/tmp-4-1657796738835 b/tmp/tmp-4-1657796738835 deleted file mode 100644 index b9a863b..0000000 Binary files a/tmp/tmp-4-1657796738835 and /dev/null differ diff --git a/tmp/tmp-4-1657882513859 b/tmp/tmp-4-1657882513859 deleted file mode 100644 index 62743be..0000000 Binary files a/tmp/tmp-4-1657882513859 and /dev/null differ diff --git a/tmp/tmp-4-1659946422398 b/tmp/tmp-4-1659946422398 deleted file mode 100644 index 25c7510..0000000 Binary files a/tmp/tmp-4-1659946422398 and /dev/null differ diff --git a/tmp/tmp-4-1659959473205 b/tmp/tmp-4-1659959473205 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-4-1659959473205 and /dev/null differ diff --git a/tmp/tmp-5-1657797501805 b/tmp/tmp-5-1657797501805 deleted file mode 100644 index 62743be..0000000 Binary files a/tmp/tmp-5-1657797501805 and /dev/null differ diff --git a/tmp/tmp-5-1657882931496 b/tmp/tmp-5-1657882931496 deleted file mode 100644 index 62743be..0000000 Binary files a/tmp/tmp-5-1657882931496 and /dev/null differ diff --git a/tmp/tmp-5-1659946527577 b/tmp/tmp-5-1659946527577 deleted file mode 100644 index 25c7510..0000000 Binary files a/tmp/tmp-5-1659946527577 and /dev/null differ diff --git a/tmp/tmp-5-1659959494012 b/tmp/tmp-5-1659959494012 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-5-1659959494012 and /dev/null differ diff --git a/tmp/tmp-6-1657797501824 b/tmp/tmp-6-1657797501824 deleted file mode 100644 index 6fb99c9..0000000 Binary files a/tmp/tmp-6-1657797501824 and /dev/null differ diff --git a/tmp/tmp-6-1657882957471 b/tmp/tmp-6-1657882957471 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-6-1657882957471 and /dev/null differ diff --git a/tmp/tmp-6-1659959536977 b/tmp/tmp-6-1659959536977 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-6-1659959536977 and /dev/null differ diff --git a/tmp/tmp-7-1657883573136 b/tmp/tmp-7-1657883573136 deleted file mode 100644 index f61ad05..0000000 Binary files a/tmp/tmp-7-1657883573136 and /dev/null differ