Skip to content

Commit

Permalink
feat: add message if no service instructeurs
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Jun 18, 2024
1 parent 6decc73 commit 8fa8f17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/backend/src/services/userService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ const assertEmailDoesNotAlreadyExist = async (email: string) => {
};

const assertEmailInWhitelist = async (email: string) => {
if (isDev) return;
const whitelist = await db.whitelist.findFirst({ where: { email } });

if (!whitelist) {
Expand Down
14 changes: 10 additions & 4 deletions packages/frontend/src/features/ServiceInstructeurSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ export const ServiceInstructeurSelect = () => {
<Combobox.Positioner>
<Combobox.Content maxH="400px" overflow="auto">
<Combobox.ItemGroup id="service-instructeur">
{items.map((item) => (
<Combobox.Item key={item.id} item={item}>
<Combobox.ItemText>{item.short_name}</Combobox.ItemText>
{items?.length ? (
items.map((item) => (
<Combobox.Item key={item.id} item={item}>
<Combobox.ItemText>{item.short_name}</Combobox.ItemText>
</Combobox.Item>
))
) : (
<Combobox.Item item={null}>
<Combobox.ItemText>Aucun résultat</Combobox.ItemText>
</Combobox.Item>
))}
)}
</Combobox.ItemGroup>
</Combobox.Content>
</Combobox.Positioner>
Expand Down

0 comments on commit 8fa8f17

Please sign in to comment.