handle change data in doctor model, set previous data when user close modal, update list doctor after update data and change key name in url
This commit is contained in:
@@ -51,7 +51,6 @@ function ModalAnswer({ doctor }) {
|
||||
request
|
||||
.postDoctorComment(comment.detail)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
let newComment = comment.rate;
|
||||
newComment = {
|
||||
correct_diagnosis: newComment[1].progress,
|
||||
@@ -62,25 +61,21 @@ function ModalAnswer({ doctor }) {
|
||||
doctor: doctor?.id,
|
||||
rate: averageRate,
|
||||
};
|
||||
console.log(newComment);
|
||||
|
||||
request
|
||||
.postDoctorRate(newComment)
|
||||
.then((res) => {
|
||||
setLoading(false);
|
||||
setOpen(false);
|
||||
console.log(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
setLoading(false);
|
||||
setOpen(false);
|
||||
console.log(err);
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
setLoading(false);
|
||||
setOpen(false);
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user