Skip to content

Commit

Permalink
[#32] api 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
03hoho03 committed Apr 7, 2024
1 parent 033241b commit 529d349
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions app/(route)/verification/ibulsin/_components/Step3/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ function Step3() {
const { mutate } = useIbulsinFormMutation()

const handleSubmit = () => {
const ideaOverView = outlineValue
const ideaOverview = outlineValue
const thinkBackground = whyTextValue
const marketTheory = marketResponseValue
const bigxyzTheory = XYZValue
const smallxyzTheory = xyzValue
const pretotypingTheory = pretotypingValue
const pretotypePlan = pretotypingValue

const body = {
ideaOverView,
ideaOverview,
thinkBackground,
marketTheory,
bigxyzTheory,
smallxyzTheory,
pretotypingTheory,
pretotypePlan,
}

mutate(body, {
Expand Down
15 changes: 10 additions & 5 deletions app/_service/mutations/useIbulsinForm.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import axiosInstance from '@/app/_utils/axios'
import { useMutation } from '@tanstack/react-query'

interface IbulsinFormBodyType {
ideaOverView: string
interface IbulsinFormDataType {
ideaOverview: string
thinkBackground: string
marketTheory: string
bigxyzTheory: string
smallxyzTheory: string
pretotypingTheory: string
pretotypePlan: string
}

const postForm = (data: IbulsinFormBodyType) => {
const response = axiosInstance.post(`/api/`, data)
const postForm = (data: IbulsinFormDataType) => {
const body = {
...data,
toolName: '아이디어 불패신화',
}
console.log(body)
const response = axiosInstance.post(`/api/toolTemplates`, body)

return response
}
Expand Down

0 comments on commit 529d349

Please sign in to comment.