Skip to content

Commit

Permalink
Fix "add job" vendor/API path when basePath is set
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobpgn committed Feb 27, 2019
1 parent 47fe774 commit c847655
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions public/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ $(document).ready(() => {
const data = localStorage.getItem('arena:savedJobData') || '{ id: \'\' }';
window.jsonEditor.set(JSON.parse(data));
});

$('.js-add-job').on('click', function() {
const data = window.jsonEditor.get();
localStorage.setItem('arena:savedJobData', JSON.stringify(data));
const { queueHost, queueName } = window.arenaInitialPayload;
$.ajax({
url: `/api/queue/${queueHost}/${queueName}/job`,
url: `${basePath}/api/queue/${queueHost}/${queueName}/job`,
type: 'POST',
data: JSON.stringify(data),
contentType: 'application/json'
Expand Down
10 changes: 5 additions & 5 deletions src/server/views/layout.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<link rel="stylesheet" href="{{ basePath }}/dashboard.css">
<script>hljs.initHighlightingOnLoad();</script>

<link rel="stylesheet" href="{{ vendorPath }}/jsoneditor.min.css">
<link rel="stylesheet" href="{{ vendorPath }}/tablesort.css">
<link rel="stylesheet" href="{{ basePath }}{{ vendorPath }}/jsoneditor.min.css">
<link rel="stylesheet" href="{{ basePath }}{{ vendorPath }}/tablesort.css">
</head>

<body>
Expand Down Expand Up @@ -66,13 +66,13 @@
<script type="text/javascript" src="{{ basePath }}/bootstrap.min.js"></script>
{{/if}}

<script type="text/javascript" src="{{ vendorPath }}/jsoneditor.min.js"></script>
<script type="text/javascript" src="{{ vendorPath }}/tablesort.min.js"></script>
<script type="text/javascript" src="{{ basePath }}{{ vendorPath }}/jsoneditor.min.js"></script>
<script type="text/javascript" src="{{ basePath }}{{ vendorPath }}/tablesort.min.js"></script>

<script type="text/javascript" src="{{ basePath }}/dashboard.js"></script>
<script>
{{{block "script"}}}
</script>
</body>

</html>
</html>

0 comments on commit c847655

Please sign in to comment.