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

Tile position editor cannot reorder into an occupied position

Đang mở
#14 0 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ó
4/5
Thời gian dự kiến
3-5 ngày
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ệ
postgresql, typescript
Lĩnh vực
backend, database

Hướng nghiên cứu

Bắt đầu với action cập nhật trong src/routes/admin/tiles/+page.server.ts và ràng buộc vị trí trong src/lib/server/db/schema.ts, sau đó kiểm tra luồng form trong src/routes/admin/tiles/+page.svelte. Tái hiện việc di chuyển từ vị trí 0 sang vị trí 1 với hai tile. Hoàn tất khi các vị trí đã được sử dụng có thể được sắp xếp lại hoặc hoán đổi an toàn, và các xung đột trả về lỗi validation thay vì lỗi cơ sở dữ liệu không được xử lý.

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

Mô tả

Problem

The admin tiles page promises reordering by position, but bingo_tile.position is unique and the update action writes the submitted position directly. Moving a tile to any existing position causes PostgreSQL's unique-constraint error instead of changing the order; swapping two positions is impossible through the UI.

Reproduction

  1. Open /admin/tiles with two tiles at positions 0 and 1.
  2. Change the position of tile 0 to 1 and save.
  3. The database rejects the update on the unique position constraint, currently surfaced as a server error.

Suggested fix

Implement a reorder operation that adjusts the intervening positions in a transaction (or use a temporary unused position for swaps), and return a validation error rather than an unhandled database error for conflicts.

Affected code

  • src/lib/server/db/schema.ts
  • src/routes/admin/tiles/+page.server.ts
  • src/routes/admin/tiles/+page.svelte
Ngôn ngữ chính
TypeScript
Star
0
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

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 hacksu/bingo

Tất cả issue của hacksu/bingo

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.