Skip to content

Commit e049523

Browse files
committed
docs: add UpdateUserForm stories
1 parent dc63484 commit e049523

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
3+
import { UpdateUserForm } from './UpdateUserForm';
4+
5+
type Story = StoryObj<typeof UpdateUserForm>;
6+
7+
export default { component: UpdateUserForm } as Meta<typeof UpdateUserForm>;
8+
9+
export const Default: Story = {
10+
args: {
11+
data: {
12+
disableDelete: false,
13+
groupOptions: {},
14+
initialValues: {
15+
additionalPermissions: [
16+
{
17+
action: 'create',
18+
subject: 'User'
19+
}
20+
]
21+
}
22+
},
23+
onDelete: () => alert('Delete!'),
24+
onSubmit: (data) => alert(JSON.stringify({ data }))
25+
}
26+
};

apps/web/src/features/admin/pages/ManageUsersPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export const ManageUsersPage = () => {
120120
setSelectedUser(null);
121121
},
122122
onSubmit: ({ groupIds, ...data }) => {
123+
console.log({ groupIds, ...data });
123124
void updateUserMutation
124125
.mutateAsync({ data: { groupIds: Array.from(groupIds), ...data }, id: selectedUser!.id })
125126
.then(() => {

0 commit comments

Comments
 (0)