score:2
Accepted answer
if you have access to companyid at the front end, all you need to do is
const response = await axios.get(`clients?id=${companyid}`);
assuming backend express is configured with query parser already.(by default)
may be you can have
const getclients = (companyid) => dispatch => {
const response = await axios.get(`clients?id=${companyid}`);
// above code here
}
let me know if you need further follow up.
score:0
you have two options there. first you pass the value of parameter as query string. the other option is to modificate your get request to a post request where you can add request body. the post request is better if you try to pass more value like an object.
Source: stackoverflow.com
Related Query
- How to send a variable to Backend - Mern Stack
- How to send FormData in MERN Stack project with TS
- MERN stack : Adding delete button in React with table. Got my backend setup with delete, but don't know how to put in up in my Frontend(React)
- How to render images from backend to frontend in mern stack
- How to organise file structure of backend and frontend in MERN
- How to deploy MERN stack to a hosting service?
- How to deal with different variable name convention in backend api and frontend
- How to send props to a variable on the basis of system wide theme in javascript?
- How to send a fetch post request from react component to backend
- How to display error to the user in MERN stack
- Heroku only displaying backend of MERN app. How can I fix this?
- how to send only one value of mail to backend if there are multiple inputs to axios post
- How to call a function when a Card is Clicked - MERN Stack
- How to extract data from material UI elements and add an onSubmit function to send data to backend
- How to send an array of files to express backend
- How to upload image file in MERN Stack Application with Multer
- How to solve this MERN stack filebase64 error?
- How do I send data from react js to backend express (React and Express)
- how to store textarea new line value into array with react and send it to node js variable with post request
- How to send json data from the backend (express.js) to the frontend (react) after res.status(404)?
- How to deploy MERN app to Heroku with frontend inside of backend folder
- How to get a variable from Frontend to the Backend using get API in reactjs with Express API
- How to load image file inline in MERN Stack Application
- How to send data and photo at same time to node js backend using axios in react js
- How can I send two different values through axios api to my backend in one request?
- How to fetch a data from an API in MERN stack web application project?
- How do I hide error(s) after a few seconds? MERN stack
- Can't send FormData to NodeJS server in MERN Stack App with TypeScript
- How to fix DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL MERN Stack
- How to access other sibling folder's package.json or organize folders for MERN stack
More Query from same tag
- Adyen's Checkout SDK integration in react app
- Reset values in an array of tuples
- React: how can I add states that are objects into a single array and access it?
- Add description to table cell
- How to style nested elements in react with styled-components?
- How does react manage CSS?
- Passing state from child class to parent
- Reactjs Copy to Clipboard that works for Excel Pasting (react-copy-to-clipboard)
- Delay in Authentication using React
- Prop-Types in React for custom object keys
- Passing custom props to a react component using typescript
- passing a dynamic url with React
- i am trying to upload file in react to firebase and setfileUrl.somehow its giving asyn promise error
- useEffect run infinitely
- React: Multiple Instances of the same component configured differently
- How to access cypress environment variable passed in from command line
- Use of onClick event handler in React
- How can I run a code after another has already ended running?
- Click button, replace enclosing component with different component
- How I can set search params when using @reach/router
- Getting a total price of cart products
- modal mode screen inside StackNavigation
- React Onclick display parent array
- How to minimize the size of webpack's bundle?
- snapshot testing react functional component useSelctor hook
- How to get the text inside a label tag on a click event in ReactJs?
- Insert React env variable into HTML script tag
- Custom actions in Material UI select MenuItem
- How to change CSS root variable in React?
- is it possible to use inline if with react components?