lint
This commit is contained in:
parent
4efa8b2f65
commit
f6249cdb8c
4 changed files with 5 additions and 11 deletions
|
|
@ -1,9 +1,8 @@
|
|||
import { Divider, Grid, ListItem, Stack, Typography } from '@mui/material';
|
||||
import { Divider, Grid, ListItem, Stack, Typography, useMediaQuery } from '@mui/material';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import { CreationInfoTag } from 'controllers';
|
||||
import ListQuestionInfo from './ListQuestionInfo';
|
||||
import { useMediaQuery } from '@mui/material';
|
||||
export default function ListQuestion({
|
||||
question_id,
|
||||
answers,
|
||||
|
|
|
|||
|
|
@ -5,14 +5,13 @@ import { editQuestion } from 'services/questionsServices';
|
|||
import { editSchema } from 'services/schemas';
|
||||
import { useQuestion } from 'contexts';
|
||||
|
||||
export default function EditFormController() {
|
||||
export default function EditQuestionFormController() {
|
||||
const {questionData} = useQuestion();
|
||||
const {title, text} = questionData;
|
||||
|
||||
|
||||
|
||||
const editTheQuestion = async (fields) => {
|
||||
console.log("hello")
|
||||
const { status } = await editQuestion(questionData.question_id, fields);
|
||||
window.location.reload(false);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { useFormik } from 'formik';
|
||||
import { useEffect } from 'react';
|
||||
import { useQuestion } from 'contexts';
|
||||
import { Form } from 'components';
|
||||
import { useForm } from 'contexts';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,22 +2,19 @@ import { createEndpoint } from './api';
|
|||
|
||||
const callQuestionsAPI = createEndpoint('/questions');
|
||||
|
||||
const searchQuestions = async (sort) => {
|
||||
console.log(sort);
|
||||
return callQuestionsAPI('get', `/search`, sort);
|
||||
};
|
||||
const searchQuestions = async (sort) => callQuestionsAPI('get', `/search`, sort);
|
||||
|
||||
const postQuestion = async (data) => callQuestionsAPI('post', ``, data);
|
||||
|
||||
const getQuestion = async (question_id) => callQuestionsAPI('get', `/${question_id}`);
|
||||
|
||||
const addBounty = async (question_id,data) => callQuestionsAPI(
|
||||
const addBounty = async (question_id, data) => callQuestionsAPI(
|
||||
'patch',
|
||||
`/${question_id}/addBounty`,
|
||||
data
|
||||
|
||||
)
|
||||
const editQuestion = async (question_id,data) => callQuestionsAPI(
|
||||
const editQuestion = async (question_id, data) => callQuestionsAPI(
|
||||
'patch',
|
||||
`/${question_id}/edit`,
|
||||
data
|
||||
|
|
|
|||
Reference in a new issue