Skip to content

fix: 인기 파견학교 상세 링크 보정 - #566

Merged
manNomi merged 3 commits into
mainfrom
fix/home-popular-university-link
Jun 22, 2026
Merged

fix: 인기 파견학교 상세 링크 보정#566
manNomi merged 3 commits into
mainfrom
fix/home-popular-university-link

Conversation

@manNomi

@manNomi manNomi commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

  • 없음

작업 내용

  • 메인 페이지의 실시간 인기있는 파견학교 카드가 상세 라우트를 만들 수 없는 경우 /university로 fallback하지 않도록 수정했습니다.
  • 추천 학교의 homeUniversityName을 추천 응답 자체, 전체 학교 목록의 id 매칭, 학기+학교명 단일 매칭 순서로 보강하도록 했습니다.
  • 추천 응답 타입에 실제 API 응답 필드인 homeUniversityName을 반영했습니다.
  • /univ-apply-infos/search/text, /univ-apply-infos/search/filter 호출에 termId, homeUniversityId 파라미터를 전달할 수 있도록 web/university-web 검색 API 계층을 보강했습니다.
  • 대학별 목록/상세 SSG 생성 시 홈대학별 homeUniversityId를 붙여 /university/{homeUniversity}/{id} 조합을 해당 대학 데이터 기준으로 생성하도록 수정했습니다.
  • 배포 환경에서 학기 env가 없을 때를 위해 DEFAULT_UNIVERSITY_TERM_ID=12 fallback을 추가했습니다. 실제 운영 학기 변경 시 UNIVERSITY_TERM_ID 또는 NEXT_PUBLIC_UNIVERSITY_TERM_ID로 덮어쓸 수 있습니다.

특이 사항

  • 현재 production API 기준 termId=12, homeUniversityId=1 조합에서 인하대 상세 SSG 경로가 생성되는 것을 build로 확인했습니다.
  • 로컬 Node 버전이 repo 권장값인 22.x가 아닌 v23.10.0이라 엔진 경고가 출력됩니다.

검증

  • pnpm --filter @solid-connect/web run lint:check
  • pnpm --filter @solid-connect/web run typecheck
  • pnpm --filter @solid-connect/university-web run lint:check
  • pnpm --filter @solid-connect/university-web run typecheck
  • NODE_ENV=production UNIVERSITY_WEB_DOMAIN=https://university-web.ci.local pnpm --filter @solid-connect/web run build
  • NODE_ENV=production pnpm --filter @solid-connect/university-web run build
  • commit hook의 web/university-web ci:check
  • pre-push hook의 web/university-web ci:checkbuild
  • 로컬 http://localhost:3000/ HTML에서 인기 파견학교 카드 href 확인

리뷰 요구사항 (선택)

  • staging/production 데이터에서도 인기 파견학교 카드가 /university/{homeUniversity}/{id}로만 이동하는지 확인 부탁드립니다.
  • 운영 학기 전환 시 UNIVERSITY_TERM_ID 또는 NEXT_PUBLIC_UNIVERSITY_TERM_ID 값이 배포 환경에 맞게 주입되는지 확인 부탁드립니다.

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solid-connect-university-web Ready Ready Preview, Comment Jun 22, 2026 5:21am
solid-connection-web Ready Ready Preview, Comment Jun 22, 2026 5:21am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connect-web-admin Skipped Skipped Jun 22, 2026 5:21am

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@manNomi, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 35 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c653b0e7-fb22-4977-ad97-c0894cdb7c46

📥 Commits

Reviewing files that changed from the base of the PR and between d4ba60a and cd8c27e.

📒 Files selected for processing (13)
  • apps/university-web/src/apis/universities/api.ts
  • apps/university-web/src/apis/universities/getSearchFilter.ts
  • apps/university-web/src/apis/universities/getSearchText.ts
  • apps/university-web/src/apis/universities/server/getSearchUniversitiesByFilter.ts
  • apps/university-web/src/apis/universities/server/getSearchUniversitiesByText.ts
  • apps/university-web/src/app/university/[homeUniversity]/[id]/page.tsx
  • apps/university-web/src/app/university/[homeUniversity]/page.tsx
  • apps/web/src/apis/universities/api.ts
  • apps/web/src/apis/universities/getSearchFilter.ts
  • apps/web/src/apis/universities/getSearchText.ts
  • apps/web/src/apis/universities/server/getSearchUniversitiesByFilter.ts
  • apps/web/src/apis/universities/server/getSearchUniversitiesByText.ts
  • apps/web/src/app/university/application/apply/ApplyPageContent.tsx

Walkthrough

이번 변경은 두 앱(apps/web, apps/university-web)에 걸쳐 대학 검색 API에 termIdhomeUniversityId 파라미터를 일괄 추가하는 작업입니다. 주요 변경 사항을 정리하면 다음과 같습니다.

  1. 공유 상수 확장
    • HomeUniversityInfohomeUniversityId 필드 추가 및 HOME_UNIVERSITY_LIST 각 항목에 ID 값 주입
    • 환경변수 미주입 시 사용할 DEFAULT_UNIVERSITY_TERM_ID = 12 상수 추가
  2. 서버 검색 API 파라미터 확장
    • getSearchUniversitiesByText, getSearchUniversitiesByFilter 및 관련 함수들에 termId·homeUniversityId 파라미터 추가
    • 환경변수 기반 getUniversityTermId 헬퍼 및 URLSearchParams 기반 엔드포인트 생성 로직 도입
  3. 클라이언트 API 파라미터 확장
    • getClientUniversityTermId 헬퍼 추가 및 getSearchText·getSearchFilter 호출 시 termId 기본값 주입
    • RecommendedUniversitiesResponseRecommendedUniversitiesItemhomeUniversityName 선택 속성 추가
  4. 정적 라우팅 및 UI 필터링 개선
    • generateStaticParamshomeUniversityId 기반 API 조회 방식으로 전환
    • 홈 페이지 추천 대학 목록에 hasUniversityDetailRoute 필터 적용
    • PopularUniversityCardhomeUniversitySlug 없을 때 null 반환으로 변경

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • wibaek
  • enunsnv
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 메인 변경사항인 인기 파견학교 상세 링크 보정을 정확하게 반영하고 있으며, 간결하고 명확합니다.
Description check ✅ Passed PR 설명이 모든 필수 섹션(관련 이슈, 작업 내용, 특이 사항, 검증)을 포함하고 있으며 매우 상세하고 체계적으로 작성되어 있습니다.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/home-popular-university-link

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@manNomi

manNomi commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@codex reveiw

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@manNomi

manNomi commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@codex reveiw

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4ba60ad2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/apis/universities/api.ts Outdated
params: { value: params?.value ?? "" },
params: {
value: params?.value ?? "",
termId: params?.termId ?? getClientUniversityTermId(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the shared search API from forcing one term

This default adds termId=DEFAULT_UNIVERSITY_TERM_ID to every client text search, but the same useUniversitySearch("") call is used by the mentor application school picker (apps/web/src/app/my/apply-mentor/_components/UniversityScreen/index.tsx), where users with AFTER_EXCHANGE status select the university and term they attended. In that flow, past-term universities no longer come back from the API, so mentors from any term other than the configured current term cannot select their school; make the term filter opt-in for catalog/popular-card callers or provide an explicit way for this shared search to request all terms.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (1)
apps/university-web/src/app/university/[homeUniversity]/[id]/page.tsx (1)

22-30: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

1) generateStaticParams의 slug별 조회는 병렬화하는 편이 빌드 시간에 유리합니다.

  • Line [22]~Line [30]은 독립 요청을 루프 내 await로 순차 처리해서, 홈대학 수만큼 대기 시간이 누적됩니다.
  • 같은 결과를 유지하면서 병렬화하면 SSG 생성 지연을 줄일 수 있습니다.
♻️ 제안 패치
 export async function generateStaticParams() {
   const params: { homeUniversity: string; id: string }[] = [];
 
-  for (const slug of HOME_UNIVERSITY_SLUGS) {
-    const homeUniversityInfo = getHomeUniversityBySlug(slug);
-    if (!homeUniversityInfo) continue;
-
-    const universities = await getAllUniversities({
-      homeUniversityId: homeUniversityInfo.homeUniversityId,
-    });
-
-    for (const university of universities) {
-      params.push({
-        homeUniversity: slug,
-        id: String(university.id),
-      });
-    }
-  }
+  const scopedUniversitiesBySlug = await Promise.all(
+    HOME_UNIVERSITY_SLUGS.map(async (slug) => {
+      const homeUniversityInfo = getHomeUniversityBySlug(slug);
+      if (!homeUniversityInfo) {
+        return { slug, universities: [] as { id: number }[] };
+      }
+
+      const universities = await getAllUniversities({
+        homeUniversityId: homeUniversityInfo.homeUniversityId,
+      });
+      return { slug, universities };
+    }),
+  );
+
+  for (const { slug, universities } of scopedUniversitiesBySlug) {
+    for (const university of universities) {
+      params.push({
+        homeUniversity: slug,
+        id: String(university.id),
+      });
+    }
+  }
 
   return params;
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/university-web/src/app/university/`[homeUniversity]/[id]/page.tsx around
lines 22 - 30, The sequential loop processing HOME_UNIVERSITY_SLUGS with await
inside causes wait times to accumulate linearly. Instead of looping through
slugs and awaiting getAllUniversities calls one at a time, create a Promise.all
pattern by first mapping over HOME_UNIVERSITY_SLUGS to create an array of
independent getAllUniversities calls, then await all of them in parallel. This
maintains the same end result while significantly reducing total execution time
by executing all independent requests concurrently rather than sequentially.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/university-web/src/apis/universities/api.ts`:
- Around line 193-194: The termId fallback at lines 193 and 203 only uses the
nullish coalescing operator (??) which doesn't validate against invalid values
like NaN, 0, or negative numbers that should trigger the fallback to
getClientUniversityTermId(). Replace the simple ?? check with validation logic
that verifies termId is a valid positive number, and only use params?.termId if
it passes validation; otherwise, use the fallback value from
getClientUniversityTermId() to prevent invalid IDs from being passed to the
query.

In
`@apps/university-web/src/apis/universities/server/getSearchUniversitiesByFilter.ts`:
- Around line 43-48: The filter validation for termId and homeUniversityId
parameters only checks for undefined values but does not validate that these
numeric fields are positive integers. This allows NaN, zero, and negative
numbers to pass through and be sent to the server, potentially causing search
failures. Enhance the conditional checks for both filters.termId and
filters.homeUniversityId (and the similar checks around lines 64-71) to validate
not only that they are not undefined, but also that they are valid positive
integers before appending them to the params object. Use appropriate number
validation logic to ensure only valid positive integer values are included in
the query parameters.

In
`@apps/university-web/src/apis/universities/server/getSearchUniversitiesByText.ts`:
- Around line 23-31: The createSearchTextEndpoint function is serializing termId
and homeUniversityId query parameters without validation, which can cause SSG
failures if invalid values like NaN, 0, or negative numbers are passed. Add
validation logic to ensure termId (set on line 26) is a valid positive integer,
and similarly validate homeUniversityId (set on line 30) before converting them
to strings. Either reject invalid values, provide sensible defaults, or only
include these parameters in the URLSearchParams when they pass validation checks
to prevent malformed queries from reaching the SSG endpoint.

In `@apps/university-web/src/app/university/`[homeUniversity]/page.tsx:
- Around line 56-58: The code is applying redundant filtering to the
universities list. The getSearchUniversitiesAllRegions function already filters
results by homeUniversityId parameter, but then lines 60-63 apply an additional
isMatchedHomeUniversityName filter that can exclude valid data that was
correctly returned from the initial query. Remove or reconsider the
isMatchedHomeUniversityName re-validation filter since the
homeUniversityId-based scope from getSearchUniversitiesAllRegions should be
sufficient, preventing the list from being abnormally reduced by duplicate
filtering logic.

In `@apps/web/src/apis/universities/api.ts`:
- Around line 193-194: The termId fallback validation is incomplete because the
nullish coalescing operator only handles null and undefined values, but does not
validate against invalid values like NaN, 0, or negative numbers that might come
from params.termId. Both instances where termId is assigned (line 193 and line
203) need to be updated to include validation that checks whether the termId
value is a valid positive number before using it, falling back to
getClientUniversityTermId() only when the current value is invalid. Add a
validation helper or inline condition that ensures termId is a valid positive
number rather than relying solely on the ?? operator.

In `@apps/web/src/apis/universities/server/getSearchUniversitiesByFilter.ts`:
- Around line 42-47: Add validation for the termId and homeUniversityId
parameters before appending them to the query params. In the conditional blocks
where filters.termId and filters.homeUniversityId are checked and appended
(around lines 42-47 and the also-applies-to section at 67-74), validate that
these values are valid positive integers before passing them to params.append.
If either value is invalid (negative, zero, or NaN), throw an appropriate error
rather than silently passing the invalid value to the query, so that invalid
requests fail with a meaningful error instead of returning empty arrays that
hide the actual problem.

In `@apps/web/src/apis/universities/server/getSearchUniversitiesByText.ts`:
- Around line 22-30: The createSearchTextEndpoint function is missing validation
for the numeric parameters termId and homeUniversityId before they are converted
to strings and added to the URLSearchParams. Add validation to ensure termId
(derived from either params.termId or getUniversityTermId()) is a valid number,
and similarly validate homeUniversityId when it is defined. If either value is
invalid or not a positive number, throw an appropriate error or handle the
invalid case to prevent malformed query parameters from being silently sent to
the API.

---

Nitpick comments:
In `@apps/university-web/src/app/university/`[homeUniversity]/[id]/page.tsx:
- Around line 22-30: The sequential loop processing HOME_UNIVERSITY_SLUGS with
await inside causes wait times to accumulate linearly. Instead of looping
through slugs and awaiting getAllUniversities calls one at a time, create a
Promise.all pattern by first mapping over HOME_UNIVERSITY_SLUGS to create an
array of independent getAllUniversities calls, then await all of them in
parallel. This maintains the same end result while significantly reducing total
execution time by executing all independent requests concurrently rather than
sequentially.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d617ba84-82a1-4017-9ed8-13ecd281f68f

📥 Commits

Reviewing files that changed from the base of the PR and between cc0ee10 and d4ba60a.

📒 Files selected for processing (14)
  • apps/university-web/src/apis/universities/api.ts
  • apps/university-web/src/apis/universities/getSearchFilter.ts
  • apps/university-web/src/apis/universities/server/getSearchUniversitiesByFilter.ts
  • apps/university-web/src/apis/universities/server/getSearchUniversitiesByText.ts
  • apps/university-web/src/app/university/[homeUniversity]/[id]/page.tsx
  • apps/university-web/src/app/university/[homeUniversity]/page.tsx
  • apps/university-web/src/constants/university.ts
  • apps/web/src/apis/universities/api.ts
  • apps/web/src/apis/universities/getSearchFilter.ts
  • apps/web/src/apis/universities/server/getSearchUniversitiesByFilter.ts
  • apps/web/src/apis/universities/server/getSearchUniversitiesByText.ts
  • apps/web/src/app/(home)/_ui/PopularUniversitySection/_ui/PopularUniversityCard.tsx
  • apps/web/src/app/(home)/page.tsx
  • apps/web/src/constants/university.ts

Comment thread apps/university-web/src/apis/universities/api.ts Outdated
Comment thread apps/university-web/src/app/university/[homeUniversity]/page.tsx Outdated
Comment thread apps/web/src/apis/universities/api.ts Outdated
@vercel
vercel Bot temporarily deployed to Preview – solid-connect-web-admin June 22, 2026 05:18 Inactive
@manNomi
manNomi merged commit bc5632d into main Jun 22, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant