Skip to content

Commit

Permalink
Dashboard endpoint bug (#1065)
Browse files Browse the repository at this point in the history
* changing url

* eslint
  • Loading branch information
JaymeeH authored Nov 22, 2024
1 parent 90ea392 commit 481ed13
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/javascript/entrypoints/dashboardTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,15 @@ export function dashStyle(railsSession) {
}

export function dashTab() {
const url = window.location.href;
$('#dash-classic').on('click', (inv) => {
const element = inv;
element.preventDefault();
$.ajax({
type: 'POST',
url: `${url}dash_classic`,
url: '/dash_classic',
data: { dashtab: 'classic' },
success() { // on success..
window.location = url; // update the DIV
window.location.reload(); // update the DIV
},
});
});
Expand All @@ -182,7 +181,7 @@ export function dashTab() {
element.preventDefault();
$.ajax({
type: 'POST',
url: `${url}dash_project`,
url: '/dash_project',
data: { dashtab: 'project' },
success() { // on success..
window.location.reload(); // update the DIV
Expand All @@ -195,7 +194,8 @@ export function dashTab() {
element.preventDefault();
$.ajax({
type: 'POST',
url: `${url}dash_activity`,

url: '/dash_activity',
data: { dashtab: 'activity' },
success() { // on success..
window.location.reload(); // update the DIV
Expand All @@ -208,7 +208,8 @@ export function dashTab() {
element.preventDefault();
$.ajax({
type: 'POST',
url: `${url}dash_admin`,

url: '/dash_admin',
data: { dashtab: 'admin' },
success() { // on success..
window.location.reload(); // update the DIV
Expand Down

0 comments on commit 481ed13

Please sign in to comment.