23 lines
527 B
JavaScript
23 lines
527 B
JavaScript
export const postComment = async (dealId, text) => {
|
|
try {
|
|
let data = {
|
|
deal_id: dealId,
|
|
text: text
|
|
};
|
|
|
|
const response = await axios.post(`/api/deals/${dealId}/comments`, data)
|
|
console.log(response)
|
|
} catch (e) {
|
|
console.error(e)
|
|
}
|
|
}
|
|
|
|
export const getComments = async (dealId) => {
|
|
try {
|
|
const response = await axios.get(`/api/deals/${dealId}/comments`)
|
|
return response.data.html
|
|
} catch (e) {
|
|
console.error(e)
|
|
}
|
|
}
|