react and rails search

 added code in the services 

+    if (stu){

+        return fetch(`${BASE_URL}students?search=${JSON.stringify(stu)}`, requestOptions).then(handleResponse);

+    }

+    else{

+        return fetch(`${BASE_URL}students`, requestOptions).then(handleResponse);

+    } 


-function getAll() {  replace it with stu

+function getAll(stu) {

shikha check after debugger first that in which data is getting...

Comments

Popular posts from this blog

Rails 7 Features :: Comparison with Rails 6 and Rails 5