Skip to content

Commit 3978b84

Browse files
authored
add unique name to absence type ui
1 parent d677461 commit 3978b84

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎client/src/entities/absenceType.jsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ const Datagrid = ({ isAdmin, children, ...props }) => {
5252
};
5353

5454
const Inputs = ({ isCreate, isAdmin }) => {
55+
const unique = useUnique({ dynamicFilter: { year: 'year' } });
5556
return (
5657
<>
5758
{!isCreate && isAdmin && <TextInput source="id" disabled />}
5859
{isAdmin && <CommonReferenceInput source="userId" reference="user" validate={required()} />}
59-
<TextInput source="name" validate={[required(), maxLength(100)]} />
60+
<TextInput source="name" validate={[required(), maxLength(100), unique()]} />
6061
<NumberInput source="quota" step={1} validate={[required()]} />
6162
<CommonYearInput validate={required()} />
6263
<ArrayInput source="requiredLabels">

0 commit comments

Comments
 (0)