Monday, 14 December 2020

Optional chaining is one of the new JavaScript language features that are available as of Node.js 14

 Optional chaining allows you to read the value of a nested property without having to check whether each preceding reference is valid. We can demonstrate this syntax in the REPL. First, we'll define a JSON object that has nested properties. Copy and paste the following into the REPL: 

Sunday, 19 July 2020

copy column from one table to another without column duplicate postgres

if you want to update data to One table from another table without duplication of data.

//Postgres Database Query
insert into table1(column1,column2)
select c1,c2
  from table2 a
 where not exists ( select 0 from table1 b where b.id = a.id )


Friday, 24 April 2020

How to add validation message to React Material UI Autocomplete?

You can firnd Autocomplete textbox of material ui on this link
When you use this autocomplete inside form and you want to set validation error message on autocomplete then you have to put the attribute to  textfield inside the <Autocomplete> Tag
Here below some example code which is working on versions dependencies
"@material-ui/core": "^4.9.4",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.50",
"@material-ui/styles": "^4.9.0"



<Autocomplete
                  value={editcountry}
                  id="combo-box-demo"                 
                  options={countryList}
                  getOptionLabel={option => option.CountryName}
                  onChange={onCountryChange}
                  disableClearable
                  style={{ width: 300 }}
                  className={classes.textField}
                  renderInput={params => (                   
                    <TextField
                      {...params}
                      error={hasError("idCountryMaster")}
                      helperText={
                        hasError("idCountryMaster") ? formState.errors.idCountryMaster[0] : null
                      }
                      label="Country Master"
                      variant="outlined"
                    />
                  )}
                />