Merge branch 'iipbs/st/dev' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into iipbs/st/dev

This commit is contained in:
2026-08-06 15:15:09 +09:00
5 changed files with 25 additions and 4 deletions
@@ -97,7 +97,7 @@ function WithBaseLayoutInner({ children }: { children: React.ReactNode }) {
useEffect(() => {
if (!getToken(CLAIM_NAME)) return;
void statisticsApi.refreshCommonCodes().catch(() => {
void statisticsApi.refreshAllCommonCodes().catch(() => {
// 캐시 동기화 실패는 화면 진입을 막지 않음
});
}, []);
@@ -279,7 +279,6 @@ const NotEnteredStatus = () => {
return;
}
const params = buildUnSubmitDataRequest(values, userInfo);
console.log(params);
if (!params.dtlInstCd) {
alert("기관 정보를 확인할 수 없습니다.");
return;
@@ -370,7 +370,7 @@ export class StatisticsApiService implements StatisticsService {
return response.data;
}
/** 공통 코드 메모리 캐시 동기화 */
/** 입력 서비스 공통 코드 메모리 캐시 동기화 */
public async refreshCommonCodes(): Promise<CodesRefreshResponse> {
const response = await stClient.post<CodesRefreshResponse>(
`${ENDPOINT.ST_SERVICE.INPUTCOMMON}/codes-refresh`,
@@ -379,6 +379,26 @@ export class StatisticsApiService implements StatisticsService {
);
return response.data;
}
/** 관리 서비스 공통 코드 메모리 캐시 동기화 */
public async refreshManagementCommonCodes(): Promise<CodesRefreshResponse> {
const response = await stClient.post<CodesRefreshResponse>(
`${ENDPOINT.ST_SERVICE.COMMON}/codes/refresh`,
null,
withAuthHeader(),
);
return response.data;
}
/** 입력/관리 공통 코드 캐시 동기화 (한쪽 실패해도 다른 쪽은 완료) */
public async refreshAllCommonCodes(): Promise<
PromiseSettledResult<CodesRefreshResponse>[]
> {
return Promise.allSettled([
this.refreshCommonCodes(),
this.refreshManagementCommonCodes(),
]);
}
}
export const statisticsApi = new StatisticsApiService();
@@ -572,4 +572,6 @@ export interface StatisticsService {
CheckStatusCode(param: CheckStatusCodeRequest): Promise<CheckStatusCodeResponse>;
getUnSubmitData(param: unSubmitDataRequest): Promise<unSubmitDataResponse>;
refreshCommonCodes(): Promise<CodesRefreshResponse>;
refreshManagementCommonCodes(): Promise<CodesRefreshResponse>;
refreshAllCommonCodes(): Promise<PromiseSettledResult<CodesRefreshResponse>[]>;
}
@@ -23,7 +23,7 @@ function LoginPage() {
try {
await authService.login({ userId, password });
try {
await statisticsApi.refreshCommonCodes();
await statisticsApi.refreshAllCommonCodes();
} catch {
// 로그인 성공 후 캐시 동기화 실패는 진입을 막지 않음
}