[st] feat: 대시보드 미제출 지표 API 변경 적용
This commit is contained in:
@@ -41,11 +41,14 @@ export function useDashboardUnSubmitCount(
|
||||
params: DashboardSearchParams | null,
|
||||
) {
|
||||
return useQuery({
|
||||
queryKey: createDashboardQueryKey("un-submit-count", params),
|
||||
queryKey: createDashboardQueryKey("submission-status", params),
|
||||
queryFn: async () => {
|
||||
if (!params)
|
||||
throw new Error("Dashboard search params are required.");
|
||||
const response = await dashboardApi.getUnSubmitCount(params);
|
||||
const response = await dashboardApi.getUnSubmitCount({
|
||||
...params,
|
||||
unSubmitOnly: true,
|
||||
});
|
||||
return response.data;
|
||||
},
|
||||
enabled: hasRequiredDashboardParams(params),
|
||||
|
||||
@@ -35,7 +35,7 @@ async function getUnSubmitCount(
|
||||
): Promise<DashboardApiResponse<UnSubmitCountResponse>> {
|
||||
const response = await stClient.get<
|
||||
DashboardApiResponse<UnSubmitCountResponse>
|
||||
>(`${ENDPOINT.ST_SERVICE.DASHBOARD}/un-submit-count`, { params });
|
||||
>(`${ENDPOINT.ST_SERVICE.DASHBOARD}/submission-status`, { params });
|
||||
return response.data;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@ export interface DashboardSearchParams {
|
||||
dtlInstCd: string;
|
||||
enoCd?: string;
|
||||
laeSeCd?: string;
|
||||
sewerBzmnCd?: string;
|
||||
sido?: string;
|
||||
sggNm?: string;
|
||||
unSubmitOnly?: boolean;
|
||||
}
|
||||
|
||||
export interface DashboardApiResponse<T> {
|
||||
@@ -34,13 +38,19 @@ export interface VrfcErrCountResponse {
|
||||
|
||||
export interface UnSubmitCountResponse {
|
||||
statsYr: string;
|
||||
unSubmitCount: number;
|
||||
unSubmitList: UnSubmitStatsResponse[];
|
||||
statusList: UnSubmitStatsResponse[];
|
||||
submittedCount: number;
|
||||
totalCount: number;
|
||||
unSubmittedCount: number;
|
||||
}
|
||||
|
||||
export interface UnSubmitStatsResponse {
|
||||
sbmsnYn: string;
|
||||
sidoSggNm: string;
|
||||
statsCd: string;
|
||||
statsNm: string;
|
||||
statusCd: string;
|
||||
statusNm: string;
|
||||
}
|
||||
|
||||
export interface StatsSubmissionResponse {
|
||||
|
||||
@@ -24,7 +24,7 @@ export function UnSubmitPanel({ params }: UnSubmitPanelProps) {
|
||||
<h3 className="text-2xl font-semibold">미제출 지표</h3>
|
||||
{data && (
|
||||
<Badge size="lg" className="rounded-full !px-3">
|
||||
{data.unSubmitCount}건
|
||||
{data.unSubmittedCount ?? 0}건
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
@@ -43,13 +43,13 @@ export function UnSubmitPanel({ params }: UnSubmitPanelProps) {
|
||||
)}
|
||||
{data && (
|
||||
<div className="h-full">
|
||||
{data.unSubmitList.length === 0 ? (
|
||||
{data.statusList.length === 0 ? (
|
||||
<div className="flex h-full items-center justify-center">
|
||||
미제출 지표가 없습니다.
|
||||
</div>
|
||||
) : (
|
||||
<div className="max-h-[48rem] space-y-2 overflow-y-auto">
|
||||
{data.unSubmitList.map((item) => (
|
||||
{data.statusList.map((item) => (
|
||||
<div
|
||||
key={item.statsCd}
|
||||
className="rounded-sm border border-border p-3"
|
||||
|
||||
Reference in New Issue
Block a user