feat(19.3-04): pact.ReorderAfterSave hook inside cabana's reorder transaction

- optional ReorderAfterSave(ctx, partition) runs after the new order is
  written; an error rolls the reorder back through lifecycleFailure
- reorderPost runs in lagoon.Transaction so lagoon.AfterCommit work a hook
  registers (a site-cache purge) runs only after the commit
- pact and cabana READMEs, admin hook table, tree reorder docs
This commit is contained in:
Jakub Zych
2026-10-15 18:27:07 +02:00
parent 0bc390f39f
commit af9dad634c
7 changed files with 28 additions and 6 deletions

View File

@@ -765,6 +765,15 @@ type FormAfterDelete interface {
FormAfterDelete(ctx context.Context, model any) error
}
// ReorderAfterSave optionally runs after a reorder save (POST .../reorder of
// a tree or sortable list) wrote the new order, inside the same transaction,
// so cabana.TxFromContext returns it and lagoon.AfterCommit work waits for
// the commit. partition is the reorder request's partition (nil when the
// list has none). A returned error rolls the reorder back.
type ReorderAfterSave interface {
ReorderAfterSave(ctx context.Context, partition *uint64) error
}
// FormVirtualFields optionally names fields of the controller's form that are
// not model columns for the purpose of the form, such as a password and its
// confirmation or a "send an invitation" checkbox. The admin framework never