Kanha Help Me

PgAdmin: Package ‘pgAdmin4’ has no installation candidate

 curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add sudo sh -c ‘echo “deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main” > /etc/apt/sources.list.d/pgadmin4.list && apt update’ sudo sh -c ‘echo “deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal/ pgadmin4 main” > /etc/apt/sources.list.d/pgadmin4.list && apt update’ sudo apt install pgadmin4

react login api example

  const [isBookingDone, setIsBookingDone] = useState(false); const [isError, setIsError] = useState(false); const [errorMessage, setErrorMessage] = useState(”); const slotBooking = async (slotTiming, bookedDate, userId) => { let config = { url: `http://localhost:3005/api/bookings`, method: ‘POST’, headers: { ‘Content-Type’: ‘application/json’, }, data: { ‘slotTiming’: slotTiming, ‘bookedDate’: bookedDate, ‘userId’: userId }, }; await axios(config).then((res) => { loadBookingData(); setIsBookingDone(true); }).catch((e) …

react login api example Read More »

call useEffect Axios api in react

  useEffect(() => { const loadPost = async () => { // Till the data is fetch using API // the Loading page will show. setIsLoading(true); // Await make wait until that // promise settles and return its result const response = await axios.get( `https://jsonplaceholder.typicode.com/posts/${bookingDate}`); // After fetching data stored it in posts state. setBookingData(response.data); …

call useEffect Axios api in react Read More »

create jwt token

  var jwt = require(‘jsonwebtoken’); let user = { email: ‘userDetails.email’, firstName: ‘userDetails.firstName’, lastName: ‘userDetails.lastName’, userType: ‘userDetails.userType’, id: ‘userDetails.id’, } const expiresInSecs = 120; const token = jwt.sign({ data: user }, ‘secret_key’, { expiresIn: 60 * 60 }); console.log(‘ttttttttt’, token)