Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat: added successful alert when adding new appointments
Browse files Browse the repository at this point in the history
Added successful alert when adding new appointments. Replicated successful alert from new patients
process and added the successful property on the translation file

re #1894
  • Loading branch information
sotous committed Mar 12, 2020
1 parent e8445f8 commit 4c0b8fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/locales/enUs/translations/scheduling/index.ts
Expand Up @@ -17,6 +17,7 @@ export default {
routine: 'Routine',
walkUp: 'Walk Up',
},
successfullyCreated: 'Appointment successfully created.',
errors: {
patientRequired: 'Patient is required.',
errorCreatingAppointment: 'Error Creating Appointment!',
Expand Down
7 changes: 6 additions & 1 deletion src/scheduling/appointments/new/NewAppointment.tsx
Expand Up @@ -7,7 +7,7 @@ import { useDispatch } from 'react-redux'
import Appointment from 'model/Appointment'
import addMinutes from 'date-fns/addMinutes'
import { isBefore } from 'date-fns'
import { Button } from '@hospitalrun/components'
import { Button, Toast } from '@hospitalrun/components'
import useAddBreadcrumbs from '../../../breadcrumbs/useAddBreadcrumbs'
import { createAppointment } from '../appointment-slice'
import AppointmentDetailForm from '../AppointmentDetailForm'
Expand Down Expand Up @@ -42,6 +42,11 @@ const NewAppointment = () => {

const onNewAppointmentSaveSuccess = (newAppointment: Appointment) => {
history.push(`/appointments/${newAppointment.id}`)
Toast(
'success',
t('Success!'),
`${t('scheduling.appointment.successfullyCreated')} ${newAppointment.id}`,
)
}

const onSave = () => {
Expand Down

0 comments on commit 4c0b8fe

Please sign in to comment.