axios.get('https://joes-autos.herokuapp.com/api/vehicles').then( res => { toast.success('Successfully got vehicles!') this.setState({ vehiclesToDisplay: res.data }) }).catch( err => toast.error('Could not retrieve vehicles!'))
.then((res) => { toast.success('수정 완료'); })
axios.get('https://joes-autos.herokuapp.com/api/buyers').then( res => { toast.success('Succesfully got Buyers') this.setState=({ buyersToDisplay: res.data }) }).catch( err => toast.err('Could not retrieve buyers'))
.then(res => { toast.success(res.data) // clear the input fields if it validates this.setState({ username: '', password: '' }) })
.then(res => { this.setState({ firstName: '', lastName: '', username: '', password: '' }) toast.success(`${res.data} You can close this notification to be redirected to the home page.`, { onClose: () => { Router.push('/') } }) })
import React from 'react' import { ToastContainer, toast, style } from 'react-toastify' const toastContent = <div>Toast!</div> // $ExpectError toast(toastContent, { type: toast.TYPE.SUCCES }) toast(toastContent, { type: toast.TYPE.SUCCESS }) // $ExpectError toast.success(toastContent, { onOpen: false }) toast.success(toastContent, { onOpen: () => console.log('open') }) // $ExpectError toast.info(toastContent, { onClose: false }) toast.info(toastContent, { onClose: () => console.log('close') }) // $ExpectError toast.warn(toastContent, { onOpen: false }) toast.warn(toastContent, { onOpen: () => console.log('open') }) // $ExpectError toast.error(toastContent, { onClose: false }) toast.error(toastContent, { onClose: () => console.log('close') }) // $ExpectError const isActiveBad: number = toast.isActive(1) const isActiveGood: boolean = toast.isActive(1) // $ExpectError toast.dismiss('1')
export const NotificationSuccess = (message) => { toast.success(message, { className: 'notification-success', bodyClassName: 'notification-body', }); };
.then((res) => { toast.success('로그인완료'); })
.then(res => { this.setState({ selection: [], selectAll: false }) this.props.clearRaffleWinners() toast.success(res.data) })
axios.put('https://joes-autos.herokuapp.com/api/vehicles/{ id }/{ priceChange }').then(res => { toast.success('Price Updated') this.setState({ vehiclesToDisplay: res.data.vehicles }) }).catch(error => toast.error("Price could not be update"));