Skip to content

Commit

Permalink
[BUG] 질문 조회 권한 확인 (#59)
Browse files Browse the repository at this point in the history
* fix: 질문 조회 권한 확인 (#58)

* test: 질문 조회 권한 확인 테스트 (#58)

* fix: 질문 조회 권한 설정 (#58)
  • Loading branch information
hyunmin0317 authored Dec 25, 2024
1 parent c753110 commit c172d64
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/api/questionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ import {AxiosResponse} from 'axios'
import {Page} from '../types/Page'
import {Question, QuestionRequest} from '../types/Question'
import jwtAxios from '../util/jwtUtil'
import api from './config'

export const fetchQuestions = async (
params: Record<string, string>
): Promise<Page<Question>> => {
if (params.page) {
params.page = (parseInt(params.page) - 1).toString()
}
const res = await api.get('/api/v1/questions', {params})
const res = await jwtAxios.get('/api/v1/questions', {params})
return res.data
}

export const fetchQuestion = async (id: string): Promise<AxiosResponse> =>
await api.get(`/api/v1/questions/${id}`)
await jwtAxios.get(`/api/v1/questions/${id}`)

export const createQuestion = async (request: QuestionRequest): Promise<AxiosResponse> =>
await jwtAxios.post('/api/v1/questions', request)
Expand Down

0 comments on commit c172d64

Please sign in to comment.