This commit is contained in:
“spicecat” 2022-07-28 20:48:26 -04:00
commit 0368060d41
7 changed files with 8 additions and 8 deletions

View file

@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
import { CreationInfoTag } from 'controllers';
export default function ListAnswer({
_id: answer_id,
answer_id,
createdAt,
creator,
downvotes,

View file

@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
import { CreationInfoTag } from 'controllers';
export default function ListQuestion({
_id: question_id,
question_id,
answers,
createdAt,
creator,

View file

@ -8,7 +8,7 @@ import { getAnswerVote, updateAnswerVote } from 'services/questionsServices';
export default function Answer({
accepted,
_id: answer_id,
answer_id,
comments,
creator,
createdAt,

View file

@ -7,7 +7,7 @@ import { getAnswerCommentVote, updateAnswerCommentVote } from 'services/question
export default function AnswerComment({
answer_id,
_id: comment_id,
comment_id,
creator,
createdAt,
downvotes,

View file

@ -4,7 +4,7 @@ import { VoteControl } from 'controllers/QAControllers';
import { getCommentVote, updateCommentVote } from 'services/questionsServices';
export default function Comment({
_id: comment_id,
comment_id,
creator,
createdAt,
downvotes,

View file

@ -14,7 +14,6 @@ const statusColor = (status) => {
}
export default function Question({
_id: question_id,
answers,
comments,
creator,
@ -24,6 +23,7 @@ export default function Question({
status,
title,
text,
question_id,
upvotes,
views
}) {

View file

@ -1,7 +1,7 @@
const config = require('server/config.json');
const Answer = require('server/db/models/Answer');
const Question = require('server/db/models/Question');
const { getAllAnswers } = require('server/utils/getData');
const { getQuestion } = require('server/utils/question');
async function GetAnswers(req, res) {
const { question_id } = req.params;
@ -12,7 +12,7 @@ async function GetAnswers(req, res) {
if (Number(question.lastAnswerFetch) + config.answerExpires < Date.now()) {
const answers = await getAllAnswers({ question_id });
return res.send({ answers });
} else{
} else {
const answers = await Answer.find({ question_id });
return res.send({ answers });
}