Prefill Data in React Form with Get API & Update Data in React Js Using Node Js API [ Part 8 -MERN ]

preview_player
Показать описание
Welcome To Saifi Code, In This Series We will make a React-redux shopping cart. We will try to make fully functional MERN Stack ecommerce website with react redux.
PART 8 contains :
How to do findbyid and update mongoose. How to redirect to another page in react on button click or redirect from one page to another in react js.
How to create update form in react js and populate the fields with api
and call the edit api in react js.

Full Series Link :
Рекомендации по теме
Комментарии
Автор

Sir, Allah Pak ka shuker hy k aj Single Page ka data Get ho geya hy..Thank you soo much..Ab Ediot kerne ki Try kerta ho..

malikbhai
Автор

Sir my ne sari video dekh li HY... KAL HAMARAA KER es per working KERO ga... PHR BATAOO GA... KEYEA BANTAA HY...

Or ap react js editor per BI work KARE

malikbhai
Автор

Sir, es ko chek kerna ab ye front end per error de rha hy...code
:
500
message
:
"server error"

malikbhai
Автор

Ab bas Clik karna hy to data Updata ho jana hy...Bass yeh chottaaa sa error ban geya hy..Es ki kese Resolve kareoo?

malikbhai
Автор

Ap us Video ka link Send kare js me ap ne Single Page id se us ka data Get keyea hy?

malikbhai
Автор

module.exports.editServices = async (req, res) => {
console.log(req.body, 31)

let newData = {}

if(req.body.title){
newData["title"] = req.body.title
}

const id = req.body.id
let filter = {_id: id}

let doc = await servicesModel.findOneAndUpdata(filter, newData, {new: true});

if(doc){
res.send({code: 200, message: "edit success", data: doc})
}else{
res.send({code: 500, message: "server error"})
}
}

malikbhai
Автор

Backend per {} atta hy...or front end per server code error atta hy..

malikbhai
Автор

const handleClick = () =>{
console.log({id: params.id, title, description})
formData,
).then(res =>{
console.log(res)
}).catch(err =>{ console.log(err)})

}

malikbhai
Автор

Yeh Code hy



const handleClick = () =>{
console.log({id: params.id, title, description, url: image})
formData
).then(res =>{
console.log(res.data)
}).catch(err =>{ console.log(err)})

}

malikbhai
Автор

13:07 yha per ap k ho geya hy...nut mujeh error de deya hy....let doc = await servicesModel.findOneAndUpdata(filter, newData );
^

TypeError: " is not a function
at module.exports.editServices

malikbhai
Автор

yeh complete backend ka code hy...but error muje Front end per lag rha hy

//Single Page get By id

module.exports.getSingleById = async (req, res) =>{
console.log(req.params, req.query, "65")
let data = await

if(data){
res.send({code: 200, message: "fetch Sing Page by id", data:data})
}else{
res.send({code: 500, message: "server error"})
}

}

malikbhai
Автор

bro share your insta id i am not abe to do edit the product if i am change the data not able to type my value

RamakrushnaPanda-dklm
visit shbcf.ru