Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added current date to the query parameter if there is no current scheduleTime provided #102

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading