Skip to content
Snippets Groups Projects
Commit 6b11a9f7 authored by brunoravera's avatar brunoravera
Browse files

navigate to reports

parent ebab84f9
No related branches found
No related tags found
No related merge requests found
import { AxiosError, toFormData } from 'axios'
import { useMutation as useRQMutation, UseMutationOptions } from 'react-query'
import { Formalization, Implementation } from 'src/models'
import { Formalization, Implementation, Report } from 'src/models'
import axiosService from 'src/services/axios-service'
export namespace RunTestsStep2Mutation {
......@@ -11,7 +11,7 @@ export namespace RunTestsStep2Mutation {
wrapperFile: File
name: string
}
export type Response = { path: string }
export type Response = Report
export const key = ['formalizations', 'run-tests-step-2']
......
......@@ -15,6 +15,7 @@ import { GetFormalizationsQuery } from 'src/pages/patterns/query-builder/get-for
import { RunTestsStep1Mutation } from '../query-builder/run-tests-step-1-mutation'
import { RunTestsStep2Mutation } from '../query-builder/run-tests-step-2-mutation'
import { useToast } from '@chakra-ui/react'
import { navigate, routes } from '@redwoodjs/router'
export function useRunTestsButton({
patternId,
......@@ -187,7 +188,9 @@ export function useRunTestsButton({
}
const step2Mutation = RunTestsStep2Mutation.useMutation({
// TODO: Navigate to Reports
onSuccess: (report) => {
navigate(routes.report({ id: report.id }))
},
})
const handleOnRunTestsStep2 = async () => {
setStep('Loading')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment