File tree 2 files changed +5
-1
lines changed
site/src/pages/CreateWorkspacePage
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ const CreateWorkspacePage: FC = () => {
127
127
defaultOwner = { me }
128
128
defaultBuildParameters = { defaultBuildParameters }
129
129
error = { createWorkspaceMutation . error }
130
+ resetMutation = { createWorkspaceMutation . reset }
130
131
template = { templateQuery . data ! }
131
132
versionId = { realizedVersionId }
132
133
externalAuth = { externalAuth ?? [ ] }
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export const Language = {
46
46
export interface CreateWorkspacePageViewProps {
47
47
mode : CreateWorkspaceMode ;
48
48
error : unknown ;
49
+ resetMutation : ( ) => void ;
49
50
defaultName : string ;
50
51
defaultOwner : TypesGen . User ;
51
52
template : TypesGen . Template ;
@@ -67,6 +68,7 @@ export interface CreateWorkspacePageViewProps {
67
68
export const CreateWorkspacePageView : FC < CreateWorkspacePageViewProps > = ( {
68
69
mode,
69
70
error,
71
+ resetMutation,
70
72
defaultName,
71
73
defaultOwner,
72
74
template,
@@ -157,7 +159,8 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
157
159
< TextField
158
160
{ ...getFieldHelpers ( "name" ) }
159
161
disabled = { creatingWorkspace }
160
- onChange = { onChangeTrimmed ( form ) }
162
+ // resetMutation facilitates the clearing of validation errors
163
+ onChange = { onChangeTrimmed ( form , resetMutation ) }
161
164
autoFocus
162
165
fullWidth
163
166
label = "Workspace Name"
You can’t perform that action at this time.
0 commit comments