Skip to content

Commit

Permalink
Merge branch 'main' into 1001_recipient_name_not_show_in_receipt_note
Browse files Browse the repository at this point in the history
  • Loading branch information
IanMayo authored Jan 25, 2024
2 parents b984869 + a5b07ce commit b0cf382
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/resources/users/UserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import EditToolBar from '../../components/EditToolBar'
import { Typography } from '@mui/material'
import { rolesOptions } from '../../utils/options'
import FlexBox from '../../components/FlexBox'

import { DateTime } from 'luxon'
const schema = yup.object({
name: yup.string().required(),
role: yup
Expand All @@ -27,19 +27,23 @@ const schema = yup.object({
})

export default function UserForm({ isEdit }: FormProps): React.ReactElement {
const valueWithTenYears = DateTime.now()
.plus({ years: 10 })
.toJSDate()
.toISOString()
const defaultValues: Omit<
User,
| 'id'
| 'createdAt'
| 'createdBy'
| 'staffNumber'
| 'departedDate'
| 'lastUpdatedAt'
| 'lockoutAttempts'
> = {
name: '',
password: '',
role: 'rco-user'
role: 'rco-user',
departedDate: valueWithTenYears
}
const { record } = useEditContext()
const pageTitle = isEdit !== undefined ? 'Edit User' : 'Add new User'
Expand Down
2 changes: 1 addition & 1 deletion src/resources/users/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ const EditVal = ({ setPrev }: EditValType): React.ReactElement => {
}

const users = {
create: UserCreate,
edit: UserEdit,
list: UserList,
show: UserShow
}

export default users
export { UserCreate }

0 comments on commit b0cf382

Please sign in to comment.