1 00:00:01,389 --> 00:00:10,289 well in this video we are going to see how to visualize the errors that appear to us 2 00:00:12,429 --> 00:00:25,030 in our from ok we have to be clear that we have used or that we are controlling 3 00:00:25,030 --> 00:00:33,630 errors that occur in the from when I write data in the username in the email or in the 4 00:00:33,630 --> 00:00:41,570 password in any of these inputs or when I send this data to the backend in the backend errors can 5 00:00:41,570 --> 00:00:47,950 occur because for example the typical actions errors that the user that we are 6 00:00:47,950 --> 00:00:55,090 trying to register already exists that the email is duplicated things of that type is worth then 7 00:00:55,090 --> 00:01:02,509 there are two points in which errors are generated also in the back-end remember that with the 8 00:01:02,509 --> 00:01:14,969 zot library and with the model that we made, well, there were two ways to control errors, for 9 00:01:14,969 --> 00:01:23,209 example we did that with soft that with a password it had six characters ok we did with the model 10 00:01:23,209 --> 00:01:33,870 we found I do not know that the email was not repeated ok then in the backend there are also two 11 00:01:33,870 --> 00:01:43,209 entries or two files that made up our project our development that of 12 00:01:43,209 --> 00:01:49,750 the ones that we read from which the front received possible errors if there were any 13 00:01:51,090 --> 00:01:57,989 ok then we are going to start first to control errors in the front itself with the 14 00:01:57,989 --> 00:02:07,730 use of force with the use of hudford sorry with the react hudford which are the ones that we have put in when 15 00:02:07,730 --> 00:02:16,729 we have done in our form it is worth that we put the register ok and we put required then 16 00:02:16,729 --> 00:02:23,389 all these we said these fields are required if some of them we do not write it is worth then 17 00:02:23,389 --> 00:02:30,710 that it puts us here a typical error in the bottom part is worth the typical the typical string 18 00:02:30,710 --> 00:02:37,129 the text line that hears the username is required is mandatory the email is mandatory always 19 00:02:37,129 --> 00:02:44,729 that we see that it is not written, it is worth then to do this and using the 20 00:02:46,689 --> 00:02:53,349 read hook form, it is worth with the read font, we use it to create that form, that is the one that 21 00:02:53,349 --> 00:03:01,129 allowed us to put the register with the name of that field and put a series of 22 00:03:01,129 --> 00:03:10,550 characteristics that should fulfill that field is worth then good from the page of 23 00:03:12,629 --> 00:03:20,409 the re ad hoc form I am going to put here a moment from here we had good all the information that 24 00:03:20,409 --> 00:03:25,889 we can control from that library is worth then from the form state that is the one that we are going to 25 00:03:25,889 --> 00:03:33,650 use now, this is the one that will allow us to take that error, well, if you are looking at all the 26 00:03:33,650 --> 00:03:40,509 information here, you see that we can put values ​​by default, such as there are several fields here that 27 00:03:40,509 --> 00:03:47,590 we could use and one of them is the errors, the errors, it is worth then here if I give it to 28 00:03:47,590 --> 00:03:54,449 view in the errors the error messages I see that I can put if an error occurs a 29 00:03:54,449 --> 00:04:02,069 string that I can put several, okay, well, you have all the information there that you can 30 00:04:02,069 --> 00:04:13,150 need at a given time, okay, well, it is the way to use it, it is a more or less simple and 31 00:04:13,150 --> 00:04:18,550 easy ok then let's go again to our code 32 00:04:21,389 --> 00:04:34,170 to see that you see it well yes ok then we have left that we are going to use the here the form state 33 00:04:34,170 --> 00:04:43,189 is worth that we take it from the read hook form ok then when we already have the use form we import 34 00:04:43,189 --> 00:04:50,329 the useform of the readcubeform, we have here the useform of which we took the register to 35 00:04:50,329 --> 00:04:59,089 enter the name of the fields and the property that is required, and the handlersummit 36 00:04:59,089 --> 00:05:06,810 which is to control the submit, the submit button when we click on the form, then here 37 00:05:06,810 --> 00:05:17,250 we are going to use or we are going to tell it that we also want to use the font state and from the form 38 00:05:17,250 --> 00:05:25,569 state that we have seen that it had several fields, it is worth several properties or attributes that 39 00:05:25,569 --> 00:05:32,009 we can use, the one we want to take is the one of errors then it is the state font and I tell it 40 00:05:32,009 --> 00:05:41,579 ok from this I want to use the errors ok in this way I am telling you that I want to use the 41 00:05:41,579 --> 00:05:55,139 object ok the data collection that will give it to me in the form of an object within errors if errors are made 42 00:05:55,139 --> 00:06:07,620 it is worth if some field of the required all those that we have put is not being executed correctly 43 00:06:07,620 --> 00:06:15,420 ok then once we have told him that we want to use the form state and the errors of the 44 00:06:15,420 --> 00:06:22,360 form state take the errors what I have to come is under each of these inputs ok and 45 00:06:22,360 --> 00:06:29,199 under each of those inputs what I am going to start to tell you is good if an error has occurred 46 00:06:29,199 --> 00:06:34,500 ok for example here in the username we are going to say 47 00:06:38,360 --> 00:06:48,069 keys errors ok that are the ones we take then within errors there is a list with all 48 00:06:48,069 --> 00:06:54,430 the possible errors ok then it is a list that is key value then we have to 49 00:06:54,430 --> 00:07:02,449 pass the first the first key that we want to control if an error has occurred in this case 50 00:07:02,449 --> 00:07:11,430 is errors and we say username ok the key and the username field is the first error that can 51 00:07:11,430 --> 00:07:19,889 produce the one that is in the register that we have called us username is worth then 52 00:07:19,889 --> 00:07:27,149 if an error has occurred in that field that it can only be obviously that we have not written it 53 00:07:27,149 --> 00:07:33,569 then what we want is good because then you are going to draw us a field is worth a paragraph 54 00:07:33,569 --> 00:07:44,009 in which we can play with already starting to play with the tailwind start to put a little 55 00:07:44,009 --> 00:07:49,290 the text that we want that you want to give it that 56 00:07:52,870 --> 00:08:00,529 that format to leave it all right ok then in this case that we can tell him 57 00:08:00,529 --> 00:08:12,089 because for example we can put a class a class and we can put a text network we are going to put it 58 00:08:12,089 --> 00:08:28,959 because for example a 700 is worth then we say ok well you put us in with this with this color that message 59 00:08:28,959 --> 00:08:41,299 le decimos que el mensaje va a ser pues el nombre de usuario obligatorio vale dentro pues ya ya se 60 00:08:41,299 --> 00:08:49,240 empezará a jugar con ese mensaje vale por ejemplo este lo quiero en negrita y además le vamos a 61 00:08:49,240 --> 00:09:03,220 put in another in a more striking color that I am going to put here the class and we are going to put the 62 00:09:03,220 --> 00:09:12,419 text network we are going to put it for example to 500 we are going to put the text xl so that it is a little 63 00:09:12,419 --> 00:09:18,740 bigger because here it is already a little what I tell you is worth that you give it a little that 64 00:09:21,580 --> 00:09:31,600 an appearance to the interface, it is worth that you want it to look good or that it is asked of you, 65 00:09:32,860 --> 00:09:46,830 okay, then I have this line, this line is worth if I update, okay, if we put, for example, 66 00:09:46,830 --> 00:09:59,299 I give it here you see when I give it to register it already comes out the name of the user mandatory 67 00:09:59,299 --> 00:10:14,019 ok let's put the is it is mandatory ok that way the user knows that here he has to write a 68 00:10:14,019 --> 00:10:22,320 name that here he writes his name is removed that there is no name because it is put again and this is what 69 00:10:22,320 --> 00:10:28,799 that I am going to do with the field of the email and the field of the password then here the only thing 70 00:10:28,799 --> 00:10:37,019 that we control is that it is mandatory well then to take this line and we are going to copy it 71 00:10:38,860 --> 00:10:45,980 now here control v now the field would not be the user name ok if you do not notice what happens 72 00:10:45,980 --> 00:10:52,200 that as when I had left the username he puts it here again and we do not want that here 73 00:10:52,200 --> 00:11:18,899 what we want to control is the field ok and the field password ok it would be then if in the 74 00:11:18,899 --> 00:11:25,179 field and mail there is nothing it already tells me user name ok this we have to change it and this 75 00:11:25,179 --> 00:11:43,399 also then here it would be e-mail it is mandatory and 76 00:11:46,029 --> 00:11:51,809 it is mandatory here it is ok then if I put the user's name this error 77 00:11:51,809 --> 00:11:58,370 no longer appears if I put the email that error is already removed from us and at the 78 00:11:58,370 --> 00:12:04,710 moment when I put a key that error is also removed from us 79 00:12:04,710 --> 00:12:09,509 ojo la clave aquí yo la estoy poniendo mal sólo he metido cuatro caracteres cuando sabemos que 80 00:12:09,509 --> 00:12:16,490 tenemos que meter como mínimo nueve vale entonces esto aquí en el from que son los errores que estoy 81 00:12:16,490 --> 00:12:25,529 controlando me lo está aceptando vale porque ve que el campo no está vacío pero si yo le doy 82 00:12:25,529 --> 00:12:31,559 to register this will give me an error 83 00:12:32,620 --> 00:12:47,740 here you are bad require with actions error ok it gives me the error of the 84 00:12:47,740 --> 00:12:54,019 actions then this is what it tells you in the response 85 00:12:57,899 --> 00:13:10,799 code here is the content this is the size 86 00:13:10,799 --> 00:13:17,740 error here it is in data it is worth in response in data it says password must have at least six 87 00:13:17,740 --> 00:13:23,879 characters it is worth 96 we put it is worth perfect because six is worth at least and we have only 88 00:13:23,879 --> 00:13:30,620 passed those four it is worth then if I come to the monkey I see because it has not been registered either 89 00:13:30,620 --> 00:13:48,100 But these Axios errors, we have used Axios in the backend and it is through which we made the connection with our Mongo database and with which we have done the different consultations. 90 00:13:48,100 --> 00:13:57,700 then we have to come we have to go now to work on our bike ok then in our 91 00:13:57,700 --> 00:14:13,340 back we have to go to the client this is ok in our controllers we had the controller and in the 92 00:14:13,340 --> 00:14:19,700 out controller we have that register function that is where we are passing from the from our 93 00:14:19,700 --> 00:14:30,980 information, it is worth having a moment and I am going to put this for a moment so that you can see the error that 94 00:14:30,980 --> 00:14:40,960 is giving me from the axis error in the response and in data ok here I have the error ok this error 95 00:14:40,960 --> 00:14:46,179 this one that we have put here as an error I am going to correct it because this is going to give us problems, it is 96 00:14:46,179 --> 00:14:55,240 easier to be the different errors that can give us that can appear for example if this 97 00:14:55,240 --> 00:15:06,700 email would be wrong ok then here in data in the axios as we have said in response in data 98 00:15:06,700 --> 00:15:11,139 password must have at least six characters 99 00:15:12,620 --> 00:15:29,980 and here he has not told me the one of the mail, okay but it would also appear to us 100 00:15:39,419 --> 00:15:53,899 we are going to do another for example we are going to put it well to see if we get mario 101 00:15:55,899 --> 00:16:05,700 we are going to do it mario is 1 2 3 4 5 6 7 8 9 I register it ok this one is not going to give me 102 00:16:05,700 --> 00:16:12,399 any problem this one has already sent us tasks that is what we had if we come to mongo I see 103 00:16:12,399 --> 00:16:21,179 that it is the one that has created that dictionary for me, it is worth it, let's go to the register again 104 00:16:27,679 --> 00:16:38,759 if I try to put Mario again good password 1 2 3 4 5 6 7 8 9 this tells me that the 105 00:16:38,759 --> 00:16:45,779 e-mail is mandatory, I tell him here and register, it is valid and here I get the 106 00:16:45,779 --> 00:16:50,519 actions error which is what I am looking for and in the actions error in the 107 00:16:50,519 --> 00:17:02,500 response in the data it will come out on the one hand in the mail is duplicated 108 00:17:02,500 --> 00:17:05,380 ok 109 00:17:05,380 --> 00:17:17,359 and it should not come out where we are here in the message 110 00:17:27,630 --> 00:17:34,930 only the month is telling me now we look at it ok but we have to control we can 111 00:17:34,930 --> 00:17:41,750 be able to these values these responses that these fields are giving us data that is giving us 112 00:17:41,750 --> 00:17:45,710 here ok that is where he is telling us the possible error that is being produced from 113 00:17:45,710 --> 00:17:53,809 axis is worth that is what we want to do then to remove this let's go to our code 114 00:17:53,809 --> 00:18:02,950 and here we are in the register function ok and then we had json 115 00:18:06,029 --> 00:18:17,650 if there was any error we would answer the message ok what is it that is what it is doing to us 116 00:18:17,650 --> 00:18:23,710 nos está enviando al final el último mensaje vale pero bueno pues no queremos hacer eso también o 117 00:18:23,710 --> 00:18:34,230 sea si por en una en una parte vale pero no solo qué queremos hacer también controlar antes de 118 00:18:34,230 --> 00:18:42,130 hacer nada dentro del track queremos controlar que el username que hemos metido existe o no existe 119 00:18:42,130 --> 00:18:53,269 ok then how am I going to do that because as we have done by launching one by launching a consultation 120 00:18:53,269 --> 00:18:59,990 ok if we do with the end when it is worth remembering at the moment you do not find a register that has 121 00:18:59,990 --> 00:19:06,690 this email is that it already exists and that error is the one or that problem is the one that we are going to control 122 00:19:06,690 --> 00:19:12,869 we are worth then we are going to do here 123 00:19:12,869 --> 00:19:20,410 inside before anything here for example I am going to put the cons here we are going to put a 124 00:19:20,410 --> 00:19:22,930 user 125 00:19:22,930 --> 00:19:31,710 we are going to tell him that it is the same as it is a consultation on the mongol is worth 126 00:19:31,710 --> 00:19:36,450 they are a database to remember always put the weight we already had 127 00:19:36,450 --> 00:19:44,009 put the async here, it is worth remembering that the water always goes with the async, okay, we have the water, we have 128 00:19:50,460 --> 00:19:58,400 a user and use it, which is the one that we are taking from the model, which is the one that is 129 00:19:58,400 --> 00:20:07,700 returning the errors to us, so we tell it, okay, well, I use point fine one, you are okay to launch 130 00:20:07,700 --> 00:20:15,700 the file one consultation that if we were looking at the login you see here we had the same then the 131 00:20:15,700 --> 00:20:22,460 fine one with a good query then we launched the query is worth here directly I am going to pass it 132 00:20:22,460 --> 00:20:35,349 with the user if you find it if you find a value with this email field that we have put 133 00:20:35,349 --> 00:20:42,109 email all together is worth then what is 134 00:20:43,109 --> 00:20:49,750 what I want you to do because then we say yes 135 00:20:49,750 --> 00:20:52,910 and a serfa 136 00:20:53,230 --> 00:21:04,980 then we are going to return a json 137 00:21:04,980 --> 00:21:10,119 status 138 00:21:10,119 --> 00:21:20,819 2.j are and here we are going to pass it I am not going to pass the error two points or the message 139 00:21:20,819 --> 00:21:25,420 two points I am going to pass that error directly ok then I am going to put it here 140 00:21:28,400 --> 00:21:40,039 because the email is already registered for example ok the email is already registered and there 141 00:21:40,039 --> 00:21:54,079 what I am doing is that launch a consultation we are controlling that the email if you find it 142 00:21:54,079 --> 00:21:59,359 or not if you have found it then it means that you cannot register that those data that we have 143 00:21:59,359 --> 00:22:08,039 sent from the front because that email already exists ok then we are going to control this like this and I am going to 144 00:22:08,039 --> 00:22:14,640 to happen as in the end the errors I want them as a global arrangement as a root of all 145 00:22:14,640 --> 00:22:20,099 the errors that occur I am going to pass them without any type of label because it will be easier 146 00:22:20,099 --> 00:22:27,740 in the front then to access them as a root is worth and then I am going to map it and what I am going to do 147 00:22:27,740 --> 00:22:33,779 is to visualize it is worth where then in the upper part for example or something like that is worth where 148 00:22:33,779 --> 00:22:43,619 we wanted, okay, so I'm going to leave this like this, okay, let's go to the file 149 00:22:43,619 --> 00:22:50,960 now, let's go back to the client because in principle already in the backend I would already have it, I'm going to go back to the 150 00:22:50,960 --> 00:23:02,750 client client src ok and here we have in the file the out context when we create the context 151 00:23:02,750 --> 00:23:10,009 tenemos que hacer que ese error que está recogiendo el from esté dentro del contexto 152 00:23:10,009 --> 00:23:15,829 porque porque queremos que tenga acceso a cualquiera de nuestras páginas si quisiéramos 153 00:23:15,829 --> 00:23:23,670 controlar el error desde cualquiera de las páginas vale en este caso estoy con la página del registro 154 00:23:23,670 --> 00:23:31,569 del registro vale pero podríamos querer utilizarlo en cualquier otra parte de nuestro contexto 155 00:23:31,569 --> 00:23:38,849 then what is what I am going to do well because we are going to create another state variable 156 00:23:38,849 --> 00:23:47,910 ok and then here we are going to put the cons we are going to put errors and here I am going to pass 157 00:23:47,910 --> 00:24:05,289 the set of errors this is going to be the same as this one and what I am going to do with the way to initialize it 158 00:24:05,289 --> 00:24:11,470 is going to be with an empty arrangement, it is worth with an empty arrangement, in principle there is no error, 159 00:24:11,470 --> 00:24:18,250 ok then as I know that what I want to pass here is an array an array with all the 160 00:24:18,250 --> 00:24:26,109 possible array errors to access them later using the map point a mapping and an index 161 00:24:26,109 --> 00:24:35,890 ok I'm going to pass that and in the error in the catch error within the trade instead of visualizing the 162 00:24:35,890 --> 00:24:41,170 console logo what I am going to say is ok well here we are going to put the set of errors 163 00:24:43,150 --> 00:24:50,950 and we are going to tell it I want you to take the error that you are sending me in the answer ok 164 00:24:50,950 --> 00:24:53,089 then we are going to put the error 165 00:24:53,089 --> 00:25:14,309 the error response data is worth the error is the one that has occurred and it is the one that I am collecting, it is worth that 166 00:25:14,309 --> 00:25:22,109 then it will be the set of all the errors that the backend is sending me, and of course 167 00:25:22,109 --> 00:25:35,160 here we say that that error is the one we want error not because we have put errors that error is 168 00:25:35,160 --> 00:25:43,940 the one we want to share with everyone in all the context is worth this way we have also 169 00:25:43,940 --> 00:25:51,559 controlled this part of the context is worth now all the all the routes that are that 170 00:25:51,559 --> 00:25:56,660 are part of that context, all of them will have access to that array of all 171 00:25:56,660 --> 00:26:03,299 possible errors, okay, and we will be able to work on them, okay, then what else 172 00:26:03,299 --> 00:26:13,460 would we have left, well, now I will say it by visualizing those errors, okay, 173 00:26:13,460 --> 00:26:18,859 depending on where we are going to do that, because it cannot be on the other side 174 00:26:18,859 --> 00:26:28,359 that it is not in the register page ok then in the register page we have first 175 00:26:30,480 --> 00:26:42,519 here you are ok this is what I have put before to try this ok we have the register we have the 176 00:26:42,519 --> 00:26:49,900 sumit to not this I have erased but I should not because the state format is what we have 177 00:26:49,900 --> 00:26:55,660 imported before for the errors in the own I will say it in the own 178 00:26:59,579 --> 00:27:11,539 from ok good but we have down here what is the use out in the use out we are saying 179 00:27:12,519 --> 00:27:20,119 what with what values are we going to work from that context ok then we have said that to 180 00:27:20,119 --> 00:27:26,400 be able to access the errors I am going to have to also take errors ok then of course now I have 181 00:27:26,400 --> 00:27:31,599 a problem because I have not noticed and I have called both the same good we can always take and 182 00:27:31,599 --> 00:27:41,700 rename that error for example that I am taking now from the register and I put it because I do not know 183 00:27:41,700 --> 00:27:49,039 register error, for example, it is worth as you want to access and then I can already access these 184 00:27:49,039 --> 00:28:00,380 errors to these variable errors through the alias that I have put on the register, 185 00:28:00,380 --> 00:28:09,200 it is not worth it and I have this perfect then where am I going to use now where am I going to visualize 186 00:28:09,200 --> 00:28:16,539 this list of possible errors, remember that at the beginning this list is empty because we have 187 00:28:16,539 --> 00:28:21,200 initialized it with an empty arrangement, it is worth then, for example, I want you to visualize them 188 00:28:21,200 --> 00:28:27,140 after registration, it is worth before starting with all the inputs, I want you to visualize it to me 189 00:28:27,140 --> 00:28:36,559 after registration thinking that the error verification itself that we have put with 190 00:28:36,559 --> 00:28:43,819 the strings below each of the inputs, okay, so I'm going to come after I register 191 00:28:45,440 --> 00:28:53,180 I'm going to say in the div ok and now as good so that it is not done well we are going to see how it 192 00:28:53,180 --> 00:29:01,160 is and if not instead of 5 xl to register because we put a little less so that it is not done that it is not 193 00:29:01,160 --> 00:29:08,319 lose on the screen ok then here what we want to do is good 194 00:29:11,400 --> 00:29:16,299 here a key is worth because I am going to work with the variables these that we are 195 00:29:16,299 --> 00:29:20,599 creating and I am going to say good if register point errors 196 00:29:20,599 --> 00:29:32,480 sorry register error this if you register errors I map those errors that mapping it is no more than 197 00:29:32,480 --> 00:29:37,460 going through that arrangement I insist it is an arrangement with all the possible errors that are 198 00:29:37,460 --> 00:29:43,759 occurring in the bucket and they are those errors that we have declared in the data model, it is worth 199 00:29:43,759 --> 00:29:49,720 remembering that because if an error occurs that you have to be very clear to then know 200 00:29:49,720 --> 00:29:56,259 what files to touch or what to look at if you are not returning at a time with the network 201 00:29:56,259 --> 00:30:02,980 the information to the front or things of that type, it is worth that they are the servers, it is worth then 202 00:30:02,980 --> 00:30:11,720 I have the map on the map we are going to do an arrow function and here I am going to pass a we are going to 203 00:30:11,720 --> 00:30:17,960 take an error the one that is in that array the first is worth and an index that is going to tell me the error 204 00:30:17,960 --> 00:30:26,940 que estoy leyendo vale aquí como es una función flecha pues como siempre vamos a hacernos nuestra 205 00:30:26,940 --> 00:30:33,319 function if the arrow is worth and here I am going to tell you 206 00:30:34,400 --> 00:31:00,519 this is worth 207 00:31:00,519 --> 00:31:12,269 this here 208 00:31:15,480 --> 00:31:22,710 this key that would be here would also give me the same 209 00:31:22,710 --> 00:31:29,349 ok we are going to pass it on then here inside 210 00:31:29,349 --> 00:31:33,190 as we want him to draw it for us in our form 211 00:31:35,309 --> 00:31:48,720 because we are going to put it because as always a day is worth this 10 is worth then here it will 212 00:31:48,720 --> 00:32:02,400 allow us to write inside what we want within that and we always put it in 213 00:32:02,400 --> 00:32:07,160 format is worth as with the tailwind with the tailwind classes we put the class 214 00:32:09,200 --> 00:32:18,440 because it is because that is the color the bg network that we are going to put for example at 500 215 00:32:21,920 --> 00:32:29,839 a pair and not two is worth a bit of always if this is all the time the same if the text is 216 00:32:29,839 --> 00:32:34,180 the background is in red because we are going to put the text 217 00:32:36,599 --> 00:32:46,059 in white, it is good what the source is and you want to change it, put an animation that would be 218 00:32:46,059 --> 00:32:54,400 very cool, well, I already leave it to your choice because in the end it does not make the video 219 00:32:54,400 --> 00:33:01,000 very long either, what else am I going to do with what else am I going to play with the one that is worth 220 00:33:01,000 --> 00:33:10,119 the attribute ok that what it collects is there it is there that we are passing to our arrow function 221 00:33:10,119 --> 00:33:19,900 which is the position of the array remember important we are all the time with an array ok ok and 222 00:33:19,900 --> 00:33:30,880 what do we want you to show us within the div? Well, the error, okay, what is inside the error, okay, 223 00:33:32,279 --> 00:33:40,420 okay, and then this, well, we would practically have it, which is what we would have to 224 00:33:40,420 --> 00:33:45,799 do now, well, it is to remember that when we have been in the backend, well, we always 225 00:33:45,799 --> 00:33:53,180 we sent the network the point json with the error such that what it does is that when it returns 226 00:33:53,180 --> 00:34:00,920 the answer it puts error two points within the response point data point error there it would write the 227 00:34:00,920 --> 00:34:06,259 error is worth that when accessing that information it can be even more cumbersome to 228 00:34:06,259 --> 00:34:15,940 facilitate it we are going to answer I am going to go to the part of the back end and I am going to tell you 229 00:34:17,199 --> 00:34:18,760 well in the middleware 230 00:34:21,900 --> 00:34:29,619 of the editor you see this is what I tell you here we put this ok we pass a map with the 231 00:34:29,619 --> 00:34:35,380 possible errors that here in the middleware is the one that we have used with zot and that is the one that 232 00:34:35,380 --> 00:34:42,139 is going to tell us the number of characters that the password has everything that we put is worth 233 00:34:42,139 --> 00:34:50,840 then this error I remove it in the end we can send information directly like this and this 234 00:34:50,840 --> 00:34:57,360 is going to make me an error directly with that information is worth then this I remove it 235 00:34:57,360 --> 00:35:10,559 from here and we have also removed it in the car where the out controller is here when we are 236 00:35:12,760 --> 00:35:22,019 here, you see that I have not put the error either, I have passed this value directly, this 237 00:35:22,019 --> 00:35:30,239 string, okay, well, in principle we would already have it, okay, we have already taken those errors that 238 00:35:30,239 --> 00:35:37,019 are sending us the back-end, we have controlled the errors that occur in the 239 00:35:37,019 --> 00:35:46,599 front itself, okay, now we are going to test it then let's go to our page here we are that if we 240 00:35:46,599 --> 00:35:54,219 damos a al registrarse bueno pues nos salen todos los campos que son obligatorios mario 241 00:35:54,219 --> 00:36:07,260 aquí le vamos a meter mario aquí vamos a meter 1 2 3 4 5 6 ya está le doy a registrarse dice 242 00:36:07,260 --> 00:36:12,880 el email ya está registrado y me lo ha puesto veis en el cuadro aquí arriba este cuadro 243 00:36:12,880 --> 00:36:20,739 in the register page that is where we have put it we are going to put it also a little following it is 244 00:36:20,739 --> 00:36:27,219 worth that we are in interfaces all the way all the format that we are giving it is worth then 245 00:36:27,219 --> 00:36:34,659 we are also putting a rounding here a little those those those those corners are worth 246 00:36:34,659 --> 00:36:43,039 then the round that gives me is worth visualizing it like this, it is worth because we could get into it until 247 00:36:43,039 --> 00:36:48,280 this was that it was centered, it is worth then we say the email is already registered if on top of it 248 00:36:48,280 --> 00:36:55,000 I did not pass it or we passed it less 249 00:36:55,000 --> 00:37:02,940 characters of the necessary ones for the password, it says the password must have 250 00:37:02,940 --> 00:37:41,780 at least six characters, okay, then let's see, clean this, delete the console, okay, here it gives us 251 00:37:41,780 --> 00:37:55,849 all bad memories and we are already picking ourselves up recovering those characters or those possible errors 252 00:37:55,849 --> 00:38:21,820 we are going to put another user here who is going to be carolina we are going to put an email that is going to be 253 00:38:21,820 --> 00:38:36,469 but we are going to put it without the origin and we are going to put the password well, for example, 254 00:38:37,469 --> 00:38:39,869 this has put us well 255 00:38:42,789 --> 00:38:46,010 this is because I have not had to control 256 00:38:48,570 --> 00:38:55,429 the emails and I thought that if I had done it with zot I mean ok then well 257 00:38:55,429 --> 00:39:09,570 If I have to register this, I do it well because the mail is already different, 258 00:39:12,710 --> 00:39:21,860 here we are going to put the same thing again and here and so the email is already registered, it 259 00:39:21,860 --> 00:39:29,539 tells us, okay, well, in principle, this is how we are going to control the 260 00:39:29,539 --> 00:39:37,420 different errors, okay, well, up to here in the next video what I'm going to do is control 261 00:39:39,420 --> 00:39:49,420 private routes or not, that is, where we can enter directly in the front, 262 00:39:49,420 --> 00:39:58,980 okay, if we are not logged, which will be in the login and in this register, okay, for that 263 00:39:58,980 --> 00:40:02,119 we also have to have the page of the login page 264 00:40:04,940 --> 00:40:09,900 and once we are logged in and that context has been created then that it gives us permission 265 00:40:09,900 --> 00:40:16,659 to enter the rest of the routes that we have declared well a greeting guys see you later