Skip to content

Commit 8962416

Browse files
committed
account.Create - redirect to account page after creation
1 parent eeee9b2 commit 8962416

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

frontend/pages/HomePage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { getFolder } from 'generated/apitypes_endpoints';
99
import { FolderResponse } from 'generated/apitypes_types';
1010
import { AppDefaultLayout } from 'layout/appdefaultlayout';
1111
import * as React from 'react';
12+
import { accountRoute } from 'routes';
1213
import { folderRoute } from 'routes';
1314

1415
interface HomePageProps {
@@ -49,7 +50,11 @@ export default class HomePage extends React.Component<HomePageProps, HomePageSta
4950
<SecretListing listing={listing} />
5051

5152
<Dropdown label="New ..">
52-
<CommandLink command={AccountCreate(this.props.folderId)} />
53+
<CommandLink
54+
command={AccountCreate(this.props.folderId, {
55+
redirect: (id) => accountRoute.buildUrl({ id }),
56+
})}
57+
/>
5358
<CommandLink command={AccountCreateFolder(this.props.folderId)} />
5459
</Dropdown>
5560
</AppDefaultLayout>

pkg/commands/handlers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ func (h *Handlers) AccountCreate(a *apitypes.AccountCreate, ctx *command.Ctx) er
256256
ctx.Meta))
257257
}
258258

259+
ctx.CreatedRecordId(accountId)
260+
259261
return nil
260262
}
261263

0 commit comments

Comments
 (0)