From b00f2f6b750dfc271609fef4a026ad61ea2e4425 Mon Sep 17 00:00:00 2001 From: Johnny Mejias Date: Tue, 2 Jan 2024 09:37:57 -0400 Subject: [PATCH] docs: add required pagination to tutorial (#11) --------- Co-authored-by: Zach Daniel --- documentation/tutorials/get-started-with-double-entry.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/documentation/tutorials/get-started-with-double-entry.md b/documentation/tutorials/get-started-with-double-entry.md index 34d5a10..184e24c 100644 --- a/documentation/tutorials/get-started-with-double-entry.md +++ b/documentation/tutorials/get-started-with-double-entry.md @@ -121,6 +121,14 @@ defmodule YourApp.Ledger.Balance do account_resource YourApp.Ledger.Account end + actions do + read :read do + primary? true + # configure keyset pagination for streaming + pagination keyset?: true, required?: false + end + end + changes do # add custom behavior. In this case, we're preventing certain balances from being less than zero change after_action(&validate_balance/2) @@ -155,6 +163,7 @@ end - Adds the following actions: - a primary read action called `:read`, if a priamry read action doesn't exist + - configure primary read action to have keyset pagination enabled - a create action caleld `:upsert_balance`, which will create or update the relevant balance, by `transfer_id` and `account_id` - Adds an identity that ensures that `account_id` and `transfer_id` are unique