Skip to content

Conversation

@BadLuckZ
Copy link
Contributor

Screenshot 2025-07-17 033920 Screenshot 2025-07-17 033955
  • Get Group's Information

@BadLuckZ BadLuckZ requested a review from Copilot July 16, 2025 20:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for fetching and displaying group information alongside user profiles.

  • Introduces a new getGroupData function to retrieve group details from the API.
  • Creates a GroupProfile component and integrates it into group-picker.astro.
  • Refactors profile.astro to align imports, redirect logic, and error handling.

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lib/profileAPI.ts Added an unused User type import
src/lib/groupAPI.ts New getGroupData function with auth check and error handling
src/components/rpkm/rubpuen/GroupProfile.tsx New component for rendering group member avatars
src/components/rpkm/components/profile.astro Updated import paths, redirect logic, and error logging
src/components/rpkm/components/group-picker.astro Integrated group data fetching and updated UI to use GroupProfile and invite code
Comments suppressed due to low confidence (4)

src/lib/groupAPI.ts:17

  • [nitpick] This error message is in Thai and mentions registration; it may be inconsistent with English messages elsewhere and confusing in the group context. Consider standardizing the language and phrasing (e.g., "Please log in to view group data").
      error: "กรุณาเข้าสู่ระบบก่อนลงทะเบียน",

src/lib/groupAPI.ts:10

  • Consider adding unit tests for getGroupData, covering both successful responses and error branches (missing token, backend failures) to ensure robust API handling.
export async function getGroupData(

src/components/rpkm/components/group-picker.astro:31

  • [nitpick] headId could be misinterpreted. Consider renaming to headStudentId or ownerStudentId to clarify that this is a student ID.
const headId = groupData.owner.studentId;

src/lib/profileAPI.ts:3

  • This User type import is not used in this file. Consider removing it to avoid lint warnings and improve clarity.
import type { User } from "@/types/common";

@RawSalmon69 RawSalmon69 merged commit 377c04c into dev Jul 17, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants