Skip to content

Commit 3db0150

Browse files
authored
minor: toasts for errors on affinity group member add (#2796)
1 parent d906190 commit 3db0150

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

app/forms/anti-affinity-group-member-add.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ export default function AddAntiAffinityGroupMemberForm({ instances, onDismiss }:
3737
queryClient.invalidateEndpoint('instanceAntiAffinityGroupList')
3838
addToast(<>Instance <HL>{variables.path.instance}</HL> added to anti-affinity group <HL>{antiAffinityGroup}</HL></>) // prettier-ignore
3939
},
40+
onError(error) {
41+
addToast({
42+
title: 'Failed to add instance to group',
43+
content: error.message,
44+
variant: 'error',
45+
})
46+
},
4047
})
4148

4249
const onSubmit = form.handleSubmit(({ instance }) => {

app/pages/project/instances/AntiAffinityCard.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ export function AddToGroupModal({ onDismiss, nonMemberGroups }: ModalProps) {
215215
</>
216216
)
217217
},
218+
onError(error) {
219+
addToast({
220+
title: 'Failed to add instance to group',
221+
content: error.message,
222+
variant: 'error',
223+
})
224+
},
218225
})
219226

220227
const handleSubmit = form.handleSubmit(({ group }) => {

0 commit comments

Comments
 (0)