Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

PATCH /profiles/current lets a participant set their participantType

Đang mở Phù hợp với người mới
#970 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
authorization

Hướng nghiên cứu

Tìm kiểu yêu cầu được dùng bởi PATCH /profiles/current và định nghĩa của UpdateProfileRequest. Trước tiên, lần theo route đến phần xác thực yêu cầu rồi so sánh với route quản trị PATCH /profiles/{profileId}. Gán cho route người tham gia một kiểu yêu cầu loại trừ participantType; hoàn tất khi các thao tác cập nhật của người tham gia không thể thay đổi trường này, còn các thao tác cập nhật của quản trị viên vẫn có thể.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

backend bug

PATCH /profiles/current writes the request body straight into the participant's profile, and UpdateProfileRequest includes participantType. So a participant can make themselves STANDARD, GUARDIAN, DEPENDENT_AGE or DEPENDENT_OTHER. The profile edit page doesn't send this field, so it takes a hand-made request.

participantType decides whose survey answers set a dependent's consent: a guardian's answers are copied to the family's dependents, combined across co-guardians. The admin route, PATCH /profiles/{profileId}, guards this. It refuses to leave a dependent with no guardian or to add a dependent to a family with no guardian, and it recalculates the dependents' answers afterwards. The participant route does none of that. A guardian can step out of their family's consent, or a participant can mark themselves a dependent in a family with no guardian, and the dependents' answers aren't recalculated either way.

Fix: give PATCH /profiles/current its own request type without participantType, and leave type changes to the admin route.

Related: #580, #585.

Ngôn ngữ chính
TypeScript
Star
4
Fork
0
Merge trung bình
14 giờ 50 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Garvan-Data-Science-Platform/ctrl

Tất cả issue của Garvan-Data-Science-Platform/ctrl

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.