Connecting the Support Request Component to the Redux Store
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

[00:00:01] Hi welcome back to the reactor cores course and this guy we are going to set up our request component here to our store similar to what we did here in the news NADJI Yes. So let's go ahead and do that quickly by first closing on every Tabra open then let's open up a support request. Hit command us to keep it in there and I will start on that. So first thing we need to do is import connect from react redux and then we just need to say down here. Export people connect support request. Can't we have that set up. We haven't read that we're connected redux. Now let's throw in a map seat props. OK. We are Mopsy props here. Now what do we need access to in here. Well we need access to our state for these for request reducer. So if you go to our index I guess we need to access this piece of state support request which is then going to give us access to the reducer which has our state for our requests came from city prompts and simply returned state DOT what to call support request something like that. Yeah. Without a capitalist. Let's go back into our index such as earning future support request. Okay cool. Cool beans let's see what we have to do now. The state does support request expected. CONAN So we just have to say let's just say for now state. So that prompts us state. [00:01:46][105.5]
[00:01:47] Now we need access to our list or list of requests so we need to set up an action with redux thuck or use relaxin cannot action so we can make a request to our server to retrieve all of our items. Each one of those items contains a status. Okay. So basically we will say okay what is the status of this item. We need to filter it based on which input box is selected. So just so you can understand as Laura explained a little bit better I'll try to sell if we open up the dev tools we have selected okay. So we're going to have another item in here similar to archive except for our support request and it's going to be called Ludzie support requests. Okay. So support requests and then in here and I specifically wanted to call a support request instead of requests mainly because it might it might have confused you if I call everything requests when we're dealing with get requests and put requests and get post requests not imagine. So I really wanted to say support requests just to really differentiate that this has nothing to do the request title has nothing to do with requests in programming. It's just happens to be a request that a user or a person is making to the complex. Yeah. Anyway let's go back to what we were talking so we have selected we are pending and then we're going to have our support requests and it's going to contain all of our items and then we're going to say OK when we have pending we want to only display the items in our view our content company if they have a status of pending and then someone with in progress incomplete. [00:03:38][110.9]
[00:03:39] So let's go ahead commit our code and get into the next guy to get status get and get commit from let's just say set up support request or let's just say connected support request component to redux store. Okay I'll catch the next get where we will develop that action so we can fetch our requests. [00:03:39][0.0]
[216.3]