Skip to content

Commit

Permalink
lowercase names
Browse files Browse the repository at this point in the history
  • Loading branch information
a-type committed Feb 9, 2025
1 parent 385a444 commit fbeaab2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/names/web/src/components/people/PersonTagEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export function PersonTagEditor({ person }: PersonTagEditorProps) {
color?: ThemeName;
icon?: IconName;
}) => {
const tag = await client.tags.put(init);
const tag = await client.tags.put({
...init,
name: init.name.trim().toLowerCase(),
});
tags.add(tag.get('name'));
};
return (
Expand Down
5 changes: 4 additions & 1 deletion packages/client/src/components/TagCreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export function TagCreateForm({
icon: undefined,
}}
onSubmit={async (values, bag) => {
await onCreate(values);
await onCreate({
...values,
name: values.name.trim().toLowerCase(),
});
bag.resetForm();
}}
className={className}
Expand Down

0 comments on commit fbeaab2

Please sign in to comment.