Skip to content

Commit

Permalink
[#50] 적극적투자지표 등록api
Browse files Browse the repository at this point in the history
  • Loading branch information
03hoho03 committed Apr 8, 2024
1 parent 1f1342b commit 5ec2ddb
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app/_service/mutations/useInvestIndicator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import axiosInstance from '@/app/_utils/axios'
import { useMutation } from '@tanstack/react-query'

interface bodyDataType {
totalInput: number
id: string | undefined
theorySet: {
name: string
score: number
people: number
}
result: number
}

const sendApi = (data: bodyDataType) => {
console.log(data)
const response = axiosInstance.post(`/api/investIndicator`, data)

return response
}

const useInvestIndicatorMutation = () => {
const { mutate } = useMutation({ mutationFn: sendApi })

return { mutate }
}

export default useInvestIndicatorMutation

0 comments on commit 5ec2ddb

Please sign in to comment.