261120_01_FIX: 삭제·권한 없는 프로젝트의 리스트 작업 기록이 남아 403이 반복 조회되는 문제 수정
This commit is contained in:
@@ -2,11 +2,10 @@
|
||||
|
||||
import { useEffect } from 'react'
|
||||
import { useAtom } from 'jotai'
|
||||
import { HttpError } from '@kri/common/http'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { ListJobProgress } from '@/components/list/ListJobProgress'
|
||||
import { useAuth } from '@/hooks/useAuth'
|
||||
import { isAvailabilityUnsupported, useListJob, useListJobAvailability, useUploadResetActive } from '@/query/list-job'
|
||||
import { isAvailabilityUnsupported, isListJobGone, useListJob, useListJobAvailability, useUploadResetActive } from '@/query/list-job'
|
||||
import { findTrackedListJob, trackListJob, untrackListJob, useTrackedListJobs } from '@/store/list-job-tracker'
|
||||
import { listJobLabel } from '@/const/listJobConst'
|
||||
import { blockerJobLabel, blockerPhaseLabel, blockerUserLabel, describeListJobAvailability } from '@/utils/listJobAvailability'
|
||||
@@ -45,7 +44,7 @@ export function useListJobGate({ prjctIdx, jobType, active, requestLabel, pollWh
|
||||
const detail = useListJob(prjctIdx, jobKey, active)
|
||||
const job = detail.data?.jobKey === jobKey ? detail.data : undefined
|
||||
const finishedJob = job && !isActiveListJob(job.jobStatus) ? job : undefined
|
||||
const detailNotFound = detail.error instanceof HttpError && detail.error.status === 404
|
||||
const detailNotFound = isListJobGone(detail.error)
|
||||
|
||||
useEffect(() => {
|
||||
if (!active && requestMatches && openRequest.opened) setOpenRequest(null)
|
||||
|
||||
@@ -4,10 +4,9 @@ import { useEffect } from 'react'
|
||||
import { usePathname, useRouter } from 'next/navigation'
|
||||
import { useAtom } from 'jotai'
|
||||
import { useQueries, useQueryClient } from '@tanstack/react-query'
|
||||
import { HttpError } from '@kri/common/http'
|
||||
import { toast } from 'sonner'
|
||||
import { nextApi } from '@/lib/http-client'
|
||||
import { listJobKeys, useMyActiveListJobs } from '@/query/list-job'
|
||||
import { isListJobGone, listJobKeys, useMyActiveListJobs } from '@/query/list-job'
|
||||
import { listJobOpenRequestAtom } from '@/store/jotai/list-job'
|
||||
import { useSelectedProject } from '@/hooks/useSelectedProject'
|
||||
import { useDialog } from '@/hooks/useDialog'
|
||||
@@ -90,7 +89,7 @@ export function ListJobWatcher({ userId, prjctIdx }: { userId: string; prjctIdx:
|
||||
details.forEach((result, index) => {
|
||||
const tracked = trackedJobs[index]
|
||||
if (!tracked) return
|
||||
if (result.error instanceof HttpError && result.error.status === 404) {
|
||||
if (isListJobGone(result.error)) {
|
||||
untrackListJob(tracked.jobKey)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user