我如何使用axios检索特定数据。它从数据库返回所有数据。我的前端是react js,后端是python django从“ axios”导入axios;
从“ ./types”导入{GET_TA};
从“ os”导入{类型};
export const getTA =批次=>调度=> {
const config = {
headers: {
"Content-Type": "application/json"
}
};
axios
.get("/api/tarecommender")
.then(res => {
dispatch({
type: GET_TA,
payload: res.data
});
})
.catch(err => console.log(err));``
};`
此代码从数据库返回了我所有的数据。如何从数据库中检索特定的ID。