| 12345678910111213141516171819202122232425262728293031323334353637 |
- import axios from '@/plugins/axios'
- import { useQuestionServer } from '@/config/server-info'
- export function getQuestionList({
- stem,
- size,
- page,
- sort
- }) {
- const params = { stem, size, page, sort }
- return axios
- .get(useQuestionServer(), { params })
- .then(res => res.data)
- }
- export function getQuestionById(questionId) {
- return axios
- .get(useQuestionServer(`/${questionId}`))
- .then(res => res.data)
- }
- export function createQuestion(questionBody) {
- return axios
- .post(useQuestionServer(), questionBody)
- .then(res => res.data)
- }
- export function updateQuestion({ questionId, questionBody }) {
- return axios
- .post(useQuestionServer(`/${questionId}`), questionBody)
- .then(res => res.data)
- }
- export function deleteQuestion(questionId) {
- return axios
- .delete(useQuestionServer(`/${questionId}`))
- }
|