import { AnswerController } from "./../Utils/Libs/requestUrls" ; import RequestApi from "Utils/Libs/requestApi" ; import { Method } from "axios" ; class Answer { updateAnswer ( content , answerIdx ) { try { const data = { content , } ; return RequestApi ( { method : "PUT" , url : AnswerController . detailAnswer ( answerIdx ) , data : data , } , { hasToken : true , } ) ; } catch ( e ) { throw new Error ( e ) ; } } saveAnswer ( uncomfortableIdx , content ) { try { const data = { content , } ; return RequestApi ( { method : "POST" , url : AnswerController . detail2Answer ( uncomfortableIdx ) , data : data , } , { hasToken : true , } ) ; } catch ( e ) { throw new Error ( e ) ; } } deleteAnswer ( answerIdx ) { try { return RequestApi ( { method : "DELETE" , url : AnswerController . detailAnswer ( answerIdx ) , } , { hasToken : true , } ) ; } catch ( e ) { throw new Error ( e ) ; } } getAnswer ( answerIdx ) { try { return RequestApi ( { method : "GET" , url : AnswerController . detailAnswer ( answerIdx ) , } ) ; } catch ( e ) { throw new Error ( e ) ; } } } export default new Answer ( ) ;