Skip to content

Commit 3b186dd

Browse files
committed
Quick fix for refreshing search
1 parent 89e337a commit 3b186dd

1 file changed

Lines changed: 24 additions & 22 deletions

File tree

views/createModal.njk

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -197,29 +197,31 @@
197197
var startDate = encodeURIComponent(new Date(calendar.view.activeStart).toISOString());
198198
var endDate = encodeURIComponent(new Date(calendar.view.activeEnd).toISOString());
199199
var searchInJira = document.getElementById('search-in-jira').checked;
200-
201-
showLoading();
202-
return fetch('/issues/user?start='+ startDate + '&end=' + endDate + "&searchInJira=" + searchInJira + "&query=" + query)
203-
.then((res) => res.json())
204-
.then(data => {
205-
var options = [];
206-
// Add options from the fetched data
207-
data.forEach(issue => {
208-
const option = {
209-
value: issue.id,
210-
label: issue.key + ' - ' +issue.summary,
211-
key: issue.key
212-
};
213-
options.push(option);
214-
});
215-
hideLoading();
216-
return options;
217-
})
218-
.catch(error => {
219-
// Handle errors
200+
if (searchInJira) {
201+
showLoading();
202+
return fetch('/issues/user?start='+ startDate + '&end=' + endDate + "&searchInJira=" + searchInJira + "&query=" + query)
203+
.then((res) => res.json())
204+
.then(data => {
205+
var options = [];
206+
// Add options from the fetched data
207+
data.forEach(issue => {
208+
const option = {
209+
value: issue.id,
210+
label: issue.key + ' - ' +issue.summary,
211+
key: issue.key
212+
};
213+
options.push(option);
214+
});
220215
hideLoading();
221-
handleError(error);
222-
});
216+
return options;
217+
})
218+
.catch(error => {
219+
// Handle errors
220+
hideLoading();
221+
handleError(error);
222+
});
223+
}
224+
223225
}
224226
</script>
225227
{% endmacro %}

0 commit comments

Comments
 (0)