Skip to content

Commit 7998354

Browse files
committed
πŸ› fix(BugStateDropdown.tsx): fix bugId variable assignment
πŸ”₯ chore(BugStateDropdown.tsx): remove console.log statement
1 parent 33d2688 commit 7998354

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

β€Žsrc/common/components/BugDetail/BugStateDropdown.tsxβ€Ž

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,18 @@ const BugStateDropdownMenu = ({
154154

155155
const BugStateDropdown = () => {
156156
const { t } = useTranslation();
157-
const { campaignId } = useParams();
157+
const { campaignId, bugId } = useParams();
158158
const [selectedItem, setSelectedItem] = useState<BugCustomStatus>();
159159
const [patchBug] = usePatchCampaignsByCidBugsAndBidMutation();
160160
const selectedBugId = getSelectedBugId();
161161

162+
let bid: string = '';
163+
if (selectedBugId) {
164+
bid = selectedBugId.toString();
165+
} else if (bugId) {
166+
bid = bugId.toString();
167+
}
168+
162169
const {
163170
data: cpCustomStatus,
164171
isLoading: isLoadingCustomStatus,
@@ -174,7 +181,7 @@ const BugStateDropdown = () => {
174181
isError: isErrorBug,
175182
} = useGetCampaignsByCidBugsAndBidQuery({
176183
cid: campaignId ? campaignId.toString() : '',
177-
bid: selectedBugId ? selectedBugId.toString() : '',
184+
bid,
178185
});
179186

180187
// Split custom statuses by phase into an object with multiple arrays
@@ -217,8 +224,6 @@ const BugStateDropdown = () => {
217224
)
218225
return null;
219226

220-
console.log('bug', bug);
221-
222227
return (
223228
<div>
224229
<MD style={{ marginBottom: appTheme.space.xxs }}>
@@ -235,7 +240,7 @@ const BugStateDropdown = () => {
235240
onSelect={async (item: BugCustomStatus) => {
236241
await patchBug({
237242
cid: campaignId ? campaignId.toString() : '',
238-
bid: selectedBugId ? selectedBugId.toString() : '',
243+
bid,
239244
body: {
240245
custom_status_id: item.id,
241246
},

0 commit comments

Comments
Β (0)