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

Feature request: accommodations for event hooks

Đang mở
#1,455 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
api, backend

Hướng nghiên cứu

Start by tracing the /update route, its POST body, and the UI's save handling using the existing network traffic described in the issue. Determine how collection and slug data, server reload signals, and HTTP error messages would fit together; done means the route contract and client behavior support these event-hook workflows.

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

Mô tả

I'm trying to add some automation & verification to my workflow. Some examples:

  • When a post is set to 'published', automatically set the 'published_at' field to the current time
  • A post may only be published if required fields are filled in
  • When a post is created, store a random nonce so I can pass around unpublished drafts with secret URLs
  • Disallow saving a post if it's already published and the slug would change
  • Alternatively, create a redirect if I change a post slug

I don't know what Keystatic plans for the long term, but I think right now I could do all of this with just a few small changes:

  1. Commit to the /update route being a stable API so I can build a middleware that intercepts it
  2. Include the collection name and slug as fields in the POST body to /update
  3. Allow the server to signal that the client needs to reload the post content. Maybe a header?
  4. Have the UI gracefully handle if the server returns an HTTP error status & error message when saving.

With these changes, my server can intercept post updates and change the content however it needs. Looking at the existing network traffic, this feels fairly non-intrusive, but offers big benefits.

Ngôn ngữ chính
TypeScript
Star
2.5k
Fork
176
Merge trung bình
5 giờ 46 phút
Pull request đã merge (30 ngày)
3

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 Thinkmill/keystatic

Tất cả issue của Thinkmill/keystatic

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.