Commit 8a7e0771 authored by Mustafa Gezen's avatar Mustafa Gezen
Browse files

fix: package build trigger fails when only_branch is not set

parent a0163f5c
......@@ -41,12 +41,15 @@ export const ShowPackage = () => {
setDisable(true);
(async () => {
const [err] = await to(
Axios.post(`/builds/`, {
package_id: pkg.id,
only_branch: onlyBranch,
})
);
const data = {
package_id: pkg.id,
};
if (onlyBranch) {
data['only_branch'] = onlyBranch;
}
const [err] = await to(Axios.post(`/builds/`, data));
if (err) {
alert('API Error');
setDisable(false);
......@@ -56,8 +59,8 @@ export const ShowPackage = () => {
setShowBuildModal(false);
setDisable(false);
setShowSuccessModal(true);
window.location.reload();
})().then();
window.location.reload();
};
const queueImport = () => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment