Skip to content

Commit

Permalink
Merge pull request #81 from marc0l92/feature/2023-05-30
Browse files Browse the repository at this point in the history
FIX: Incorrect value shown when field empty #78
  • Loading branch information
marc0l92 authored May 30, 2023
2 parents 7eeb6b6 + 6d2064b commit 790ffce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/interfaces/issueInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const newEmptyUser = () => {
} as IJiraUser
}

const EMPTY_ISSUE: IJiraIssue = {
const buildEmptyIssue = (): IJiraIssue => JSON.parse(JSON.stringify({
key: '',
id: '',
account: null,
Expand Down Expand Up @@ -285,7 +285,7 @@ const EMPTY_ISSUE: IJiraIssue = {
worklogs: []
}
},
}
} as IJiraIssue))

function isObject(item: any): boolean {
return (item && typeof item === 'object' && !Array.isArray(item))
Expand Down Expand Up @@ -319,7 +319,7 @@ function mergeDeep(target: any, ...sources: any[]): any {

export function toDefaultedIssue(originalIssue: IJiraIssue): IJiraIssue {
if (originalIssue) {
return mergeDeep(EMPTY_ISSUE, originalIssue)
return mergeDeep(buildEmptyIssue(), originalIssue)
}
return originalIssue
}

0 comments on commit 790ffce

Please sign in to comment.