diff --git a/ui/src/tasks/api/v2/index.ts b/ui/src/tasks/api/v2/index.ts index 0246572b15..621d1704f7 100644 --- a/ui/src/tasks/api/v2/index.ts +++ b/ui/src/tasks/api/v2/index.ts @@ -33,16 +33,20 @@ export const updateTaskFlux = async (url, id, flux: string): Promise => { export const getUserTasks = async (url, user): Promise => { 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 => { 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) => {