Merge pull request #1259 from influxdata/tasks/fix-task-nesting

Fix api calls for tasks, tasks are now nested in response
pull/10616/head
Brandon Farmer 2018-10-31 14:39:38 -07:00 committed by GitHub
commit 184e8e8923
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -33,16 +33,20 @@ export const updateTaskFlux = async (url, id, flux: string): Promise<Task> => {
export const getUserTasks = async (url, user): Promise<Task[]> => {
const completeUrl = `${url}?user=${user.id}`
const {data} = await AJAX({url: completeUrl})
const {
data: {tasks},
} = await AJAX({url: completeUrl})
return data
return tasks
}
export const getTask = async (url, id): Promise<Task> => {
const completeUrl = `${url}/${id}`
const {data} = await AJAX({url: completeUrl})
const {
data: {task},
} = await AJAX({url: completeUrl})
return data
return task
}
export const deleteTask = (url: string, taskID: string) => {