Skip to content

Commit

Permalink
Added current date to the query parameter if there is no current sche…
Browse files Browse the repository at this point in the history
…duleTime provided

fixes #97
  • Loading branch information
stijndeleeuw authored and geirsagberg committed Apr 24, 2024
1 parent 38d966c commit 598ff3a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions db-scheduler-ui-frontend/src/services/runTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ const API_BASE_URL: string =
window.location.origin + '/db-scheduler-api';

const runTask = async (id: string, name: string, scheduleTime?:Date) => {

const queryParams = new URLSearchParams();

queryParams.append('id', id);
queryParams.append('name', name);
scheduleTime&&queryParams.append('scheduleTime', scheduleTime.toISOString());
if (scheduleTime) {
queryParams.append('scheduleTime', scheduleTime.toISOString());
} else {
queryParams.append('scheduleTime', new Date().toISOString());
}

const response = await fetch(
`${API_BASE_URL}/tasks/rerun?${queryParams}`,
Expand Down

0 comments on commit 598ff3a

Please sign in to comment.