fix
This commit is contained in:
parent
2009978979
commit
0368060d41
7 changed files with 8 additions and 8 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { getAnswerVote, updateAnswerVote } from 'services/questionsServices';
|
|||
|
||||
export default function Answer({
|
||||
accepted,
|
||||
_id: answer_id,
|
||||
answer_id,
|
||||
comments,
|
||||
creator,
|
||||
createdAt,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { getAnswerCommentVote, updateAnswerCommentVote } from 'services/question
|
|||
|
||||
export default function AnswerComment({
|
||||
answer_id,
|
||||
_id: comment_id,
|
||||
comment_id,
|
||||
creator,
|
||||
createdAt,
|
||||
downvotes,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}) {
|
||||
|
|
|
|||
|
|
@ -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 });
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue