structure ready
Deploy Node App / deploy (push) Successful in 25s

This commit is contained in:
Gitea
2026-06-15 15:43:09 +05:30
commit 41d82f9266
12 changed files with 6460 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
const postgre = require('../database/postgre');
const AnsweredQuestions = async (req, res) => {
try {
const user_id = req.user.id;
const result = await postgre.query(
'SELECT * FROM useraskquestion WHERE user_id = $1 And status = $2 ORDER BY id DESC',
[user_id, '1']
);
res.json({
success: true,
data: result.rows
});
} catch (error) {
res.status(500).json({
success: false,
message: error.message
});
}
};
const UnansweredQuestions = async (req, res) => {
try {
const user_id = req.user.id;
const result = await postgre.query(
'SELECT * FROM useraskquestion WHERE user_id = $1 And status = $2 ORDER BY id DESC',
[user_id, '0']
);
res.json({
success: true,
data: result.rows
});
} catch (error) {
res.status(500).json({
success: false,
message: error.message
});
}
};
module.exports = {
AnsweredQuestions,
UnansweredQuestions
};