feat: 내가 작성한 매물/문의 경로 별 적용 구현
- 메인 화면에서 진입 시 내가 작성한 매물/문의 해제 - 사이드바에서 진입 시 내가 작성환 매물/문의 체크
This commit is contained in:
parent
c9eea4be03
commit
f693062d96
@ -6,13 +6,14 @@ import { InquiryRequest } from '@/types/Inquiry'
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { CONFIRM_MESSAGE, SUCCESS_MESSAGE, useAlertMsg, WARNING_MESSAGE } from '@/hooks/useAlertMsg'
|
import { CONFIRM_MESSAGE, SUCCESS_MESSAGE, useAlertMsg, WARNING_MESSAGE } from '@/hooks/useAlertMsg'
|
||||||
|
import { useInquiryFilterStore } from '@/store/inquiryFilterStore'
|
||||||
|
|
||||||
export default function RegistForm() {
|
export default function RegistForm() {
|
||||||
const { saveInquiry, isSavingInquiry, commonCodeList } = useInquiry(undefined, false)
|
const { saveInquiry, isSavingInquiry, commonCodeList } = useInquiry(undefined, false)
|
||||||
const { showErrorAlert, showSuccessAlert, showConfirm } = useAlertMsg()
|
const { showErrorAlert, showSuccessAlert, showConfirm } = useAlertMsg()
|
||||||
const { session } = useSessionStore()
|
const { session } = useSessionStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const { setIsMyInquiry } = useInquiryFilterStore()
|
||||||
const [inquiryRequest, setInquiryRequest] = useState<InquiryRequest>({
|
const [inquiryRequest, setInquiryRequest] = useState<InquiryRequest>({
|
||||||
compCd: '5200',
|
compCd: '5200',
|
||||||
siteTpCd: 'QC',
|
siteTpCd: 'QC',
|
||||||
@ -301,7 +302,13 @@ export default function RegistForm() {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div className="btn-flex-wrap">
|
<div className="btn-flex-wrap">
|
||||||
<button className="btn-frame n-blue icon" onClick={() => router.push('/inquiry/list')}>
|
<button
|
||||||
|
className="btn-frame n-blue icon"
|
||||||
|
onClick={() => {
|
||||||
|
setIsMyInquiry(session?.userId ?? null)
|
||||||
|
router.push('/inquiry/list')
|
||||||
|
}}
|
||||||
|
>
|
||||||
リスト<i className="btn-arr"></i>
|
リスト<i className="btn-arr"></i>
|
||||||
</button>
|
</button>
|
||||||
<button className="btn-frame n-blue icon" onClick={handleSubmit} disabled={isSavingInquiry}>
|
<button className="btn-frame n-blue icon" onClick={handleSubmit} disabled={isSavingInquiry}>
|
||||||
|
|||||||
@ -1,18 +1,25 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useInquiryFilterStore } from '@/store/inquiryFilterStore'
|
import { useInquiryFilterStore } from '@/store/inquiryFilterStore'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter, useSearchParams } from 'next/navigation'
|
||||||
import { useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useAlertMsg, WARNING_MESSAGE } from '@/hooks/useAlertMsg'
|
import { useAlertMsg, WARNING_MESSAGE } from '@/hooks/useAlertMsg'
|
||||||
|
|
||||||
export default function ListForm() {
|
export default function ListForm() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { inquiryListRequest, setInquiryListRequest, reset, setOffset } = useInquiryFilterStore()
|
const { inquiryListRequest, setInquiryListRequest, setOffset } = useInquiryFilterStore()
|
||||||
const { showErrorAlert } = useAlertMsg()
|
const { showErrorAlert } = useAlertMsg()
|
||||||
const [searchKeyword, setSearchKeyword] = useState(inquiryListRequest.schTitle ?? '')
|
const [searchKeyword, setSearchKeyword] = useState(inquiryListRequest.schTitle ?? '')
|
||||||
|
const searchParams = useSearchParams()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (searchParams.get('isMyInquiry') === 'false') {
|
||||||
|
setSearchKeyword('')
|
||||||
|
setInquiryListRequest({ ...inquiryListRequest, schTitle: null })
|
||||||
|
}
|
||||||
|
}, [searchParams])
|
||||||
|
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
if (searchKeyword.length >= 2) {
|
if (searchKeyword.length >= 2) {
|
||||||
reset()
|
|
||||||
setInquiryListRequest({ ...inquiryListRequest, schTitle: searchKeyword })
|
setInquiryListRequest({ ...inquiryListRequest, schTitle: searchKeyword })
|
||||||
} else {
|
} else {
|
||||||
showErrorAlert(WARNING_MESSAGE.KEYWORD_MINIMUM_LENGTH)
|
showErrorAlert(WARNING_MESSAGE.KEYWORD_MINIMUM_LENGTH)
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { useEffect, useState } from 'react'
|
|||||||
import LoadMoreButton from '../../LoadMoreButton'
|
import LoadMoreButton from '../../LoadMoreButton'
|
||||||
import { useInquiry } from '@/hooks/useInquiry'
|
import { useInquiry } from '@/hooks/useInquiry'
|
||||||
import { InquiryList } from '@/types/Inquiry'
|
import { InquiryList } from '@/types/Inquiry'
|
||||||
import { usePathname, useRouter } from 'next/navigation'
|
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
|
||||||
import { useInquiryFilterStore } from '@/store/inquiryFilterStore'
|
import { useInquiryFilterStore } from '@/store/inquiryFilterStore'
|
||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
import ListForm from './ListForm'
|
import ListForm from './ListForm'
|
||||||
@ -26,27 +26,37 @@ export default function ListTable() {
|
|||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
|
|
||||||
const { inquiryList, isLoadingInquiryList } = useInquiry(undefined, true)
|
const { inquiryList, isLoadingInquiryList } = useInquiry(undefined, true)
|
||||||
const { inquiryListRequest, setInquiryListRequest, reset, offset, setOffset } = useInquiryFilterStore()
|
const { inquiryListRequest, setInquiryListRequest, reset, offset, setOffset, isMyInquiry, setIsMyInquiry } = useInquiryFilterStore()
|
||||||
|
|
||||||
const [hasMore, setHasMore] = useState(false)
|
const [hasMore, setHasMore] = useState(false)
|
||||||
|
|
||||||
const [heldInquiryList, setHeldInquiryList] = useState<InquiryList[]>([])
|
const [heldInquiryList, setHeldInquiryList] = useState<InquiryList[]>([])
|
||||||
|
|
||||||
const { session } = useSessionStore()
|
const { session } = useSessionStore()
|
||||||
|
const searchParams = useSearchParams()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setOffset(1)
|
setOffset(1)
|
||||||
setHeldInquiryList([])
|
setHeldInquiryList([])
|
||||||
}, [pathname])
|
}, [pathname, searchParams])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!session.isLoggedIn || isLoadingInquiryList) return
|
if (!session.isLoggedIn || isLoadingInquiryList) return
|
||||||
if (session.isLoggedIn) {
|
if (session.isLoggedIn) {
|
||||||
setInquiryListRequest({ ...inquiryListRequest, storeId: session.storeId ?? '', loginId: session.userId ?? '' })
|
setInquiryListRequest({ ...inquiryListRequest, storeId: session.storeId ?? '', loginId: session.userId ?? '' })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (searchParams.get('isMyInquiry') === 'true') {
|
||||||
|
setIsMyInquiry(session.userId)
|
||||||
|
router.replace('/inquiry/list')
|
||||||
|
} else if (searchParams.get('isMyInquiry') === 'false') {
|
||||||
|
reset()
|
||||||
|
router.replace('/inquiry/list')
|
||||||
|
}
|
||||||
|
|
||||||
if (inquiryList.length > 0 && inquiryList[0].totCnt > 0) {
|
if (inquiryList.length > 0 && inquiryList[0].totCnt > 0) {
|
||||||
if (offset > 1) {
|
if (offset > 1) {
|
||||||
setHeldInquiryList([...heldInquiryList, ...inquiryList])
|
setHeldInquiryList((prev) => [...prev, ...inquiryList])
|
||||||
} else {
|
} else {
|
||||||
setHeldInquiryList(inquiryList)
|
setHeldInquiryList(inquiryList)
|
||||||
}
|
}
|
||||||
@ -55,15 +65,12 @@ export default function ListTable() {
|
|||||||
setHeldInquiryList([])
|
setHeldInquiryList([])
|
||||||
setHasMore(false)
|
setHasMore(false)
|
||||||
}
|
}
|
||||||
}, [session, inquiryList])
|
}, [session, inquiryList, searchParams])
|
||||||
|
|
||||||
/** 내 문의 필터 처리 - 체크 시 자신의 문의 목록만 조회 */
|
/** 내 문의 필터 처리 - 체크 시 자신의 문의 목록만 조회 */
|
||||||
const handleMyInquiry = () => {
|
const handleMyInquiry = () => {
|
||||||
setOffset(1)
|
setOffset(1)
|
||||||
setInquiryListRequest({
|
setIsMyInquiry(isMyInquiry ? null : session.userId)
|
||||||
...inquiryListRequest,
|
|
||||||
schRegId: inquiryListRequest.schRegId ? null : session.userId,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 답변 여부 필터 처리리 */
|
/** 답변 여부 필터 처리리 */
|
||||||
@ -76,7 +83,7 @@ export default function ListTable() {
|
|||||||
setInquiryListRequest({ ...inquiryListRequest, schAnswerYn: 'Y' })
|
setInquiryListRequest({ ...inquiryListRequest, schAnswerYn: 'Y' })
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
reset()
|
setInquiryListRequest({ ...inquiryListRequest, schAnswerYn: null })
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -88,7 +95,7 @@ export default function ListTable() {
|
|||||||
<div className="inquiry-table-filter">
|
<div className="inquiry-table-filter">
|
||||||
<div className="filter-check">
|
<div className="filter-check">
|
||||||
<div className="check-form-box">
|
<div className="check-form-box">
|
||||||
<input type="checkbox" id="ch01" onChange={handleMyInquiry} checked={inquiryListRequest.schRegId === session.userId} />
|
<input type="checkbox" id="ch01" onChange={handleMyInquiry} checked={isMyInquiry === session.userId} />
|
||||||
<label htmlFor="ch01">私が書いたお問い合わせ</label>
|
<label htmlFor="ch01">私が書いたお問い合わせ</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
import LoadMoreButton from '@/components/LoadMoreButton'
|
import LoadMoreButton from '@/components/LoadMoreButton'
|
||||||
import { useSurvey } from '@/hooks/useSurvey'
|
import { useSurvey } from '@/hooks/useSurvey'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useRouter, usePathname } from 'next/navigation'
|
import { useRouter, usePathname, useSearchParams } from 'next/navigation'
|
||||||
import SearchForm from './SearchForm'
|
import SearchForm from './SearchForm'
|
||||||
import { useSurveyFilterStore } from '@/store/surveyFilterStore'
|
import { useSurveyFilterStore } from '@/store/surveyFilterStore'
|
||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
@ -14,20 +14,32 @@ export default function ListTable() {
|
|||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
|
|
||||||
const { surveyList, isLoadingSurveyList } = useSurvey()
|
const { surveyList, isLoadingSurveyList } = useSurvey()
|
||||||
const { offset, setOffset } = useSurveyFilterStore()
|
const { offset, setOffset, setIsMySurvey, reset } = useSurveyFilterStore()
|
||||||
|
|
||||||
const { session } = useSessionStore()
|
const { session } = useSessionStore()
|
||||||
|
|
||||||
const [heldSurveyList, setHeldSurveyList] = useState<SurveyBasicInfo[]>([])
|
const [heldSurveyList, setHeldSurveyList] = useState<SurveyBasicInfo[]>([])
|
||||||
const [hasMore, setHasMore] = useState(false)
|
const [hasMore, setHasMore] = useState(false)
|
||||||
|
|
||||||
|
const searchParams = useSearchParams()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setOffset(0)
|
setOffset(0)
|
||||||
setHeldSurveyList([])
|
setHeldSurveyList([])
|
||||||
}, [pathname])
|
}, [pathname, searchParams])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isLoadingSurveyList) return
|
if (searchParams.get('isMySurvey') === 'true') {
|
||||||
|
setIsMySurvey(session.userId)
|
||||||
|
router.replace('/survey-sale')
|
||||||
|
} else if (searchParams.get('isMySurvey') === 'false') {
|
||||||
|
reset()
|
||||||
|
router.replace('/survey-sale')
|
||||||
|
}
|
||||||
|
}, [searchParams])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isLoadingSurveyList || !session.isLoggedIn) return
|
||||||
|
|
||||||
if ('count' in surveyList && surveyList.count > 0) {
|
if ('count' in surveyList && surveyList.count > 0) {
|
||||||
if (offset > 0) {
|
if (offset > 0) {
|
||||||
setHeldSurveyList((prev) => [...prev, ...surveyList.data])
|
setHeldSurveyList((prev) => [...prev, ...surveyList.data])
|
||||||
@ -39,7 +51,7 @@ export default function ListTable() {
|
|||||||
setHeldSurveyList([])
|
setHeldSurveyList([])
|
||||||
setHasMore(false)
|
setHasMore(false)
|
||||||
}
|
}
|
||||||
}, [surveyList, offset, isLoadingSurveyList])
|
}, [surveyList, offset, isLoadingSurveyList, searchParams])
|
||||||
|
|
||||||
const handleDetailClick = (id: number) => {
|
const handleDetailClick = (id: number) => {
|
||||||
router.push(`/survey-sale/${id}`)
|
router.push(`/survey-sale/${id}`)
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { SEARCH_OPTIONS, SEARCH_OPTIONS_ENUM, SEARCH_OPTIONS_PARTNERS, useSurveyFilterStore } from '@/store/surveyFilterStore'
|
import { SEARCH_OPTIONS, SEARCH_OPTIONS_ENUM, SEARCH_OPTIONS_PARTNERS, useSurveyFilterStore } from '@/store/surveyFilterStore'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter, useSearchParams } from 'next/navigation'
|
||||||
import { useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useAlertMsg, WARNING_MESSAGE } from '@/hooks/useAlertMsg'
|
import { useAlertMsg, WARNING_MESSAGE } from '@/hooks/useAlertMsg'
|
||||||
|
|
||||||
export default function SearchForm({ memberRole, userId }: { memberRole: string; userId: string }) {
|
export default function SearchForm({ memberRole, userId }: { memberRole: string; userId: string }) {
|
||||||
@ -11,6 +11,13 @@ export default function SearchForm({ memberRole, userId }: { memberRole: string;
|
|||||||
const { setSearchOption, setSort, setIsMySurvey, setKeyword, isMySurvey, keyword, searchOption, sort, setOffset } = useSurveyFilterStore()
|
const { setSearchOption, setSort, setIsMySurvey, setKeyword, isMySurvey, keyword, searchOption, sort, setOffset } = useSurveyFilterStore()
|
||||||
const [searchKeyword, setSearchKeyword] = useState(keyword)
|
const [searchKeyword, setSearchKeyword] = useState(keyword)
|
||||||
const [option, setOption] = useState(searchOption)
|
const [option, setOption] = useState(searchOption)
|
||||||
|
const searchParams = useSearchParams()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (searchParams.get('isMySurvey') === 'false') {
|
||||||
|
setSearchKeyword('')
|
||||||
|
}
|
||||||
|
}, [searchParams])
|
||||||
|
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
if (option !== 'id' && searchKeyword.trim().length < 2) {
|
if (option !== 'id' && searchKeyword.trim().length < 2) {
|
||||||
@ -39,8 +46,6 @@ export default function SearchForm({ memberRole, userId }: { memberRole: string;
|
|||||||
value={option}
|
value={option}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (e.target.value === 'all') {
|
if (e.target.value === 'all') {
|
||||||
setKeyword('')
|
|
||||||
setSearchKeyword('')
|
|
||||||
setSearchOption('all')
|
setSearchOption('all')
|
||||||
setOption('all')
|
setOption('all')
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export default function Main() {
|
|||||||
<div className="main-bx-icon">
|
<div className="main-bx-icon">
|
||||||
<img src="/assets/images/main/main_icon01.svg" alt="" />
|
<img src="/assets/images/main/main_icon01.svg" alt="" />
|
||||||
</div>
|
</div>
|
||||||
<button className="main-bx-arr" onClick={() => router.push('/survey-sale')}></button>
|
<button className="main-bx-arr" onClick={() => router.push('/survey-sale?isMySurvey=false')}></button>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-bx-body">
|
<div className="grid-bx-body">
|
||||||
<div className="grid-bx-body-tit">調査物件一覧</div>
|
<div className="grid-bx-body-tit">調査物件一覧</div>
|
||||||
@ -46,7 +46,7 @@ export default function Main() {
|
|||||||
<div className="main-bx-icon">
|
<div className="main-bx-icon">
|
||||||
<img src="/assets/images/main/main_icon03.svg" alt="" />
|
<img src="/assets/images/main/main_icon03.svg" alt="" />
|
||||||
</div>
|
</div>
|
||||||
<button className="main-bx-arr" onClick={() => router.push('/inquiry/list')}></button>
|
<button className="main-bx-arr" onClick={() => router.push('/inquiry/list?isMyInquiry=false')}></button>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-bx-body">
|
<div className="grid-bx-body">
|
||||||
<div className="grid-bx-body-tit">1:1お問い合わせ リスト</div>
|
<div className="grid-bx-body-tit">1:1お問い合わせ リスト</div>
|
||||||
|
|||||||
@ -11,8 +11,6 @@ import { useSideNavState } from '@/store/sideNavState'
|
|||||||
import { useHeaderStore } from '@/store/header'
|
import { useHeaderStore } from '@/store/header'
|
||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
import { usePopupController } from '@/store/popupController'
|
import { usePopupController } from '@/store/popupController'
|
||||||
import { useSurveyFilterStore } from '@/store/surveyFilterStore'
|
|
||||||
import { useInquiryFilterStore } from '@/store/inquiryFilterStore'
|
|
||||||
|
|
||||||
import { useTitle } from '@/hooks/useTitle'
|
import { useTitle } from '@/hooks/useTitle'
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
@ -32,9 +30,6 @@ export default function Header() {
|
|||||||
|
|
||||||
const popupController = usePopupController()
|
const popupController = usePopupController()
|
||||||
|
|
||||||
const { setIsMySurvey } = useSurveyFilterStore()
|
|
||||||
const { setInquiryListRequest, inquiryListRequest } = useInquiryFilterStore()
|
|
||||||
|
|
||||||
if (pathname === '/login') {
|
if (pathname === '/login') {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@ -88,8 +83,7 @@ export default function Header() {
|
|||||||
<div
|
<div
|
||||||
className="side-swiper-card"
|
className="side-swiper-card"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsMySurvey(session?.userId)
|
router.push('/survey-sale?isMySurvey=true')
|
||||||
router.push('/survey-sale')
|
|
||||||
setSideNavIsOpen(false)
|
setSideNavIsOpen(false)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -101,8 +95,7 @@ export default function Header() {
|
|||||||
<div
|
<div
|
||||||
className="side-swiper-card"
|
className="side-swiper-card"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setInquiryListRequest({ ...inquiryListRequest, schRegId: session?.userId })
|
router.push('/inquiry/list?isMyInquiry=true')
|
||||||
router.push('/inquiry/list')
|
|
||||||
setSideNavIsOpen(false)
|
setSideNavIsOpen(false)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -35,7 +35,7 @@ export function useInquiry(
|
|||||||
commonCodeList: CommonCode[]
|
commonCodeList: CommonCode[]
|
||||||
} {
|
} {
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const { inquiryListRequest, offset } = useInquiryFilterStore()
|
const { inquiryListRequest, offset, isMyInquiry } = useInquiryFilterStore()
|
||||||
const { axiosInstance } = useAxios()
|
const { axiosInstance } = useAxios()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { showErrorAlert } = useAlertMsg()
|
const { showErrorAlert } = useAlertMsg()
|
||||||
@ -104,7 +104,7 @@ export function useInquiry(
|
|||||||
* @returns {boolean} isLoading - 문의사항 목록 로딩 상태
|
* @returns {boolean} isLoading - 문의사항 목록 로딩 상태
|
||||||
*/
|
*/
|
||||||
const { data: inquiryList, isLoading: isLoadingInquiryList } = useQuery({
|
const { data: inquiryList, isLoading: isLoadingInquiryList } = useQuery({
|
||||||
queryKey: ['inquiryList', inquiryListRequest, offset],
|
queryKey: ['inquiryList', inquiryListRequest.loginId, inquiryListRequest.schTitle, inquiryListRequest.schAnswerYn, offset, isMyInquiry],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const isListQuery = true
|
const isListQuery = true
|
||||||
const shouldThrowError = false
|
const shouldThrowError = false
|
||||||
@ -112,7 +112,7 @@ export function useInquiry(
|
|||||||
const resp = await tryFunction(
|
const resp = await tryFunction(
|
||||||
() =>
|
() =>
|
||||||
axiosInstance(null).get<{ data: InquiryList[] }>(`/api/qna/list`, {
|
axiosInstance(null).get<{ data: InquiryList[] }>(`/api/qna/list`, {
|
||||||
params: { inquiryListRequest, startRow: offset, endRow: offset + 9 },
|
params: { inquiryListRequest, startRow: offset, endRow: offset + 9, schRegId: isMyInquiry },
|
||||||
}),
|
}),
|
||||||
isListQuery,
|
isListQuery,
|
||||||
shouldThrowError,
|
shouldThrowError,
|
||||||
|
|||||||
@ -10,6 +10,8 @@ type InquiryFilterState = {
|
|||||||
reset: () => void
|
reset: () => void
|
||||||
offset: number
|
offset: number
|
||||||
setOffset: (offset: number) => void
|
setOffset: (offset: number) => void
|
||||||
|
isMyInquiry: string | null
|
||||||
|
setIsMyInquiry: (isMyInquiry: string | null) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -28,7 +30,6 @@ export const useInquiryFilterStore = create<InquiryFilterState>((set) => ({
|
|||||||
storeId: '',
|
storeId: '',
|
||||||
siteTpCd: 'QC',
|
siteTpCd: 'QC',
|
||||||
schTitle: null,
|
schTitle: null,
|
||||||
schRegId: null,
|
|
||||||
schFromDt: null,
|
schFromDt: null,
|
||||||
schToDt: null,
|
schToDt: null,
|
||||||
schAnswerYn: null,
|
schAnswerYn: null,
|
||||||
@ -42,15 +43,17 @@ export const useInquiryFilterStore = create<InquiryFilterState>((set) => ({
|
|||||||
langCd: 'JA',
|
langCd: 'JA',
|
||||||
storeId: '',
|
storeId: '',
|
||||||
siteTpCd: 'QC',
|
siteTpCd: 'QC',
|
||||||
schTitle: '',
|
schTitle: null,
|
||||||
schRegId: '',
|
schFromDt: null,
|
||||||
schFromDt: '',
|
schToDt: null,
|
||||||
schToDt: '',
|
|
||||||
schAnswerYn: null,
|
schAnswerYn: null,
|
||||||
loginId: '',
|
loginId: '',
|
||||||
},
|
},
|
||||||
offset: 1,
|
offset: 1,
|
||||||
|
isMyInquiry: null,
|
||||||
}),
|
}),
|
||||||
offset: 1,
|
offset: 1,
|
||||||
setOffset: (offset) => set({ offset }),
|
setOffset: (offset) => set({ offset }),
|
||||||
|
isMyInquiry: null,
|
||||||
|
setIsMyInquiry: (isMyInquiry) => set({ isMyInquiry }),
|
||||||
}))
|
}))
|
||||||
|
|||||||
@ -12,8 +12,6 @@ export type InquiryListRequest = {
|
|||||||
siteTpCd: string
|
siteTpCd: string
|
||||||
/* 검색 제목 */
|
/* 검색 제목 */
|
||||||
schTitle: string | null
|
schTitle: string | null
|
||||||
/* 검색 등록자 ID */
|
|
||||||
schRegId: string | null
|
|
||||||
/* 검색 시작 일자 */
|
/* 검색 시작 일자 */
|
||||||
schFromDt: string | null
|
schFromDt: string | null
|
||||||
/* 검색 종료 일자 */
|
/* 검색 종료 일자 */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user