undefined / api /helpContent.js
tuandesu's picture
hãy tạo một trang reactjs với tính năng cho phép admin load nội dung help từ file .html hoặc txt, sau đó hiện lên UI cho user, nếu login bằng admin thì hiện link edit --> click vào link này thì mở ra dialog để admin sửa nội dung help trong một HtmlEditor
d35c7df verified
raw
history blame contribute delete
483 Bytes
import axios from 'axios';
export const getHelpContent = async () => {
return axios.get('/api/help-content');
};
export const updateHelpContent = async (content) => {
return axios.put('/api/help-content', { content });
};
export const importHelpContent = async (file) => {
const formData = new FormData();
formData.append('file', file);
return axios.post('/api/help-content/import', formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
});
};