Skip to content

Commit

Permalink
Fix epic editing problems
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianruesch committed Dec 28, 2023
1 parent 9caa0e3 commit 2a3b998
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ export class JiraCloudProvider implements IProvider {
...(summary && {
summary,
}),
...(epic && epic.issueKey && {
...(epic && epic.issueKey !== undefined && {
parent: { key: epic.issueKey },
}),
...(type && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ export class JiraServerProvider implements IProvider {
...(summary && {
summary,
}),
...(epic && epic.issueKey && {
...(epic && epic.issueKey !== undefined && {
parent: { key: epic.issueKey },
}),
...(type && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function EditableEpic({
})
const [selectedEpic, setSelectedEpic] = useState(epic.issueKey)
const mutationEpic = useMutation({
mutationFn: (epicKey: string) => editIssue({ epic: { issueKey: epicKey } } as Issue, issueKey),
mutationFn: (epicKey: string | null) => editIssue({ epic: { issueKey: epicKey } } as Issue, issueKey),
onError: () => {
showNotification({
message: `An error occurred while modifing the Epic 😢`,
Expand Down Expand Up @@ -64,8 +64,8 @@ export function EditableEpic({
ItemComponent={SelectItem}
value={selectedEpic}
onChange={(value) => {
setSelectedEpic(value!)
mutationEpic.mutate(value!)
setSelectedEpic(value)
mutationEpic.mutate(value ?? null)
setShowEpicInput(false)
}}
/>
Expand Down

0 comments on commit 2a3b998

Please sign in to comment.