import { NextResponse } from 'next/server'
import { axiosInstance } from '@/libs/axios'

export async function POST(req: Request) {
  const { loginId, email, pwd, chgPwd } = await req.json()
  console.log('🚀 ~ POST ~ loginId:', loginId)
  console.log('🚀 ~ POST ~ email:', email)
  console.log('🚀 ~ POST ~ pwd:', pwd)
  console.log('🚀 ~ POST ~ chgPwd:', chgPwd)

  const result = await axiosInstance(`${process.env.NEXT_PUBLIC_QSP_API_URL}`).post(`/api/user/userPwdChg`, {
    loginId,
    chgType: 'C',
    email,
    pwd,
    chgPwd,
  })
  console.log('🚀 ~ result ~ result:', result)

  return NextResponse.json({ code: 200, data: result.data })
}
