Skip to content

Feat/41/integrate frontend backend update user profile - #89

Merged
Minyulite merged 11 commits into
mainfrom
feat/41/Integrate-frontend-backend-update-user-profile
Sep 12, 2026
Merged

Minyulite merged 11 commits into
mainfrom
feat/41/Integrate-frontend-backend-update-user-profile

Conversation

@chotiwatt

@chotiwatt chotiwatt commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

User Story ID

41

Description

Summary

  • เชื่อมหน้า Edit Profile กับ GET /users/me และ PUT /users/profile
  • รองรับการแก้ไขชื่อและ bio รวมถึงระดับชั้น/เป้าหมายของ student และราคาต่อชั่วโมงของ tutor
  • รองรับ profileUrl: null เพื่อให้ผู้ใช้ที่ยังไม่มีรูปบันทึกได้
  • อัปเดตฟอร์มและ session หลังบันทึกสำเร็จ พร้อมจัดการ session หมดอายุ
  • คง UI จาก branch feat/40/edit-profile-ui โดยปุ่มอัปโหลดรูปยังปิดไว้( ฝนบอกรูปภาพเดี๋ยวค่อยทำผมเลยไปเเก้ api ให้มันรับ url เป็น null ได้อ่ะ"

Checklist

  • I have self-reviewed my code and works locally
  • I have tagged a reviewer for this PR
  • I have assigned myself as a assignee for this PR
  • I have linked the related issue(s) to this PR
  • yarn lint passes locally

Screenshot(s)

image image image

Remark

@chotiwatt
chotiwatt requested a review from Minyulite September 11, 2026 18:21
@chotiwatt chotiwatt self-assigned this Sep 11, 2026
@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
se-project-web Ready Ready Preview Sep 12, 2026 3:04am UTC
1 Skipped Deployment
Project Deployment Actions Updated
se-project-api Skipped Skipped Sep 12, 2026 3:04am UTC

@chotiwatt chotiwatt linked an issue Sep 11, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "tools"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e902d254-52db-4980-8f26-c9ee4e19b5d7

📥 Commits

Reviewing files that changed from the base of the PR and between f825832 and b58ffbd.

📒 Files selected for processing (2)
  • apps/web/src/components/profile/profile-completion-form.tsx
  • apps/web/src/components/profile/profile-edit-form.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/components/profile/profile-edit-form.tsx

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

เพิ่มหน้าแก้ไขโปรไฟล์สำหรับนักเรียนและติวเตอร์ รองรับการแก้ไขข้อมูลและวิชาที่สอน ปรับ API สำหรับตรวจสอบและบันทึก subject IDs และเพิ่มการนำทางไปยังหน้าใหม่

Changes

สัญญา API และการบันทึกข้อมูล

Layer / File(s) Summary
สัญญา API และชนิดข้อมูลการอัปเดต
apps/api/src/controller/user.controller.ts, apps/api/src/router/user.router.ts
รองรับ profileUrl: null, subjectIds ที่เป็น UUID ไม่ซ้ำ และ response ของ PUT /users/profile ที่มีข้อมูลโปรไฟล์เต็มรูปแบบ
การตรวจสอบและบันทึกวิชาของติวเตอร์
apps/api/src/service/user.service.ts, apps/api/src/repository/subject.repository.ts, apps/api/src/repository/user.repository.ts
ตรวจสอบ subject IDs ที่มีอยู่ ล้างและสร้างความสัมพันธ์ tutorSubjects ใหม่ และแปลงผลลัพธ์โปรไฟล์ผ่าน mapProfile

ส่วนติดต่อผู้ใช้สำหรับแก้ไขโปรไฟล์

Layer / File(s) Summary
ชนิดข้อมูลและตัวช่วยฝั่งเว็บ
apps/web/src/types/profile.ts, apps/web/src/types/user.ts, apps/web/src/lib/api-client.ts, apps/web/src/components/profile/profile-completion-form.tsx
เพิ่มชนิดข้อมูลโปรไฟล์ เมธอด apiClient.put และค่าระดับชั้นสำหรับฟอร์ม
หน้าและฟอร์มแก้ไขโปรไฟล์
apps/web/src/app/profile/edit/page.tsx, apps/web/src/components/profile/profile-edit-form.tsx, apps/web/src/components/ui/multi-select.tsx, apps/web/src/components/ui/multi-select.stories.tsx
โหลดข้อมูลโปรไฟล์และวิชา ตรวจสอบฟิลด์ ส่งข้อมูลตาม role และรองรับตัวเลือกแบบ label/value
เส้นทางเข้าสู่หน้าแก้ไขโปรไฟล์
apps/web/src/components/Navbar.tsx, apps/web/src/components/profile/profile-details.tsx
เพิ่มลิงก์ My profile และลิงก์ Edit Profile ไปยัง /profile/edit พร้อมลบปุ่มแก้ไขเดิมจากส่วนหัว

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ProfileEditForm
  participant user.controller
  participant user.service
  participant userRepository
  User->>ProfileEditForm: แก้ไขข้อมูลโปรไฟล์
  ProfileEditForm->>user.controller: PUT /users/profile
  user.controller->>user.service: ส่ง ProfileUpdateRequest
  user.service->>userRepository: บันทึกโปรไฟล์และ tutorSubjects
  userRepository-->>user.service: ส่ง UserProfileRow
  user.service-->>ProfileEditForm: ส่งข้อมูลโปรไฟล์ที่อัปเดต
Loading

Merge Risk: ⚪ Minimal · up to b58ff

The profile-editing changes have no confirmed correctness or integration risk requiring a merge block.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 16 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed คำอธิบายระบุ User Story ID, รายละเอียดการเปลี่ยนแปลง, Checklist ที่ทำเครื่องหมายครบ, และภาพหน้าจอที่เกี่ยวข้อง เนื้อหาสอดคล้องกับวัตถุประสงค์ของ PR แม้ส่วน Remark จะว่าง แต่ไม่ใช่ข้อมูลสำคัญที่ทำให้คำ…
Title check ✅ Passed ชื่อ PR ระบุการเชื่อมต่อ Frontend และ Backend สำหรับการอัปเดตโปรไฟล์ ซึ่งตรงกับการเปลี่ยนแปลงหลักของ PR
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/41/Integrate-frontend-backend-update-user-profile

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/web/src/components/profile/profile-completion-form.tsx

Oops! Something went wrong! :(

ESLint: 10.10.0

Error: Cannot read config file: /.eslint-tmp/node_modules/eslint-config-next/index.js
Error: Failed to patch ESLint because the calling module was not recognized.
If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:
https://github.com/microsoft/rushstack/issues
Referenced from: /.eslint-tmp/node_modules/eslint-config-next/core-web-vitals.js
at Object. (/.eslint-tmp/node_modules/@rushstack/eslint-patch/lib-commonjs/_patch-base.js:244:19)
at Module._compile (node:internal/modules/cjs/loader:1830:14)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.require (node:internal/modules/cjs/loader:1576:12)
at require (node:internal/modules/helpers:153:16)
at Object. (/.eslint-tmp/node_modules/@rushstack/eslint-patch/lib-commonjs/modern-module-resolution.js:11:23)
at Module._compile (node:internal/modules/cjs/loader:1830:14)

apps/web/src/components/profile/profile-edit-form.tsx

ESLint skipped: the matched ESLint configuration already failed (config-incompatibility).


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.

"University",
"Other",
];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Brother, I think putting GRADE_LEVELS back to this file would be a great idea. I encourage you to delete grade-levels.ts.

Comment thread apps/web/src/lib/grade-levels.ts Outdated
Comment on lines +1 to +10
export const GRADE_LEVELS = [
"Grade 7",
"Grade 8",
"Grade 9",
"Grade 10",
"Grade 11",
"Grade 12",
"University",
"Other",
];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Delete this.

@Minyulite

Copy link
Copy Markdown
Contributor

Brother, before you fix, please run "git pull origin " because I have created new api for subject and merged it to this branch.

…nd-update-user-profile' into feat/41/Integrate-frontend-backend-update-user-profile

# Conflicts:
#	apps/web/src/components/profile/profile-edit-form.tsx
@Minyulite

Copy link
Copy Markdown
Contributor

LGTM

@Minyulite
Minyulite merged commit 06e2ea6 into main Sep 12, 2026
5 checks passed
@github-actions
github-actions Bot deleted the feat/41/Integrate-frontend-backend-update-user-profile branch September 12, 2026 03:48

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – se-project-web — b58ffbd4 Deployed Sep 12, 2026 by vercel[bot]
Preview – se-project-api — b58ffbd4 Deployed Sep 12, 2026 by vercel[bot]
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.

Integrate frontend & backend update user profile

2 participants