This repository has been archived on 2025-11-04. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
qoverflow/server/routes/user/Questions.js

15 lines
344 B
JavaScript

const Question = require('../../db/models/Question');
async function Questions(req, res) {
const {
user: { username },
} = req;
const cachedQuestions = await Question.find({
creator: username,
}).sort({ createdAt: 'desc' });
return res.send({ questions: cachedQuestions });
}
module.exports = Questions;