Skip to content

Commit 79f49c0

Browse files
committed
docs: module is already aliased in the controller examples.
1 parent 405710e commit 79f49c0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,20 @@ defmodule MutationController do
174174
user_id = conn.assigns.user_id
175175

176176
{:ok, txid, _changes} =
177-
Phoenix.Sync.Writer.new()
178-
|> Phoenix.Sync.Writer.allow(
177+
Writer.new()
178+
|> Writer.allow(
179179
Projects.Project,
180180
check: reject_invalid_params/2,
181181
load: &Projects.load_for_user(&1, user_id),
182182
validate: &Projects.Project.changeset/2
183183
)
184-
|> Phoenix.Sync.Writer.allow(
184+
|> Writer.allow(
185185
Projects.Issue,
186186
# Use the sensible defaults:
187187
# validate: Projects.Issue.changeset/2
188188
# etc.
189189
)
190-
|> Phoenix.Sync.Writer.apply(transaction, Repo, format: Format.TanstackDB)
190+
|> Writer.apply(transaction, Repo, format: Format.TanstackDB)
191191

192192
render(conn, :mutations, txid: txid)
193193
end

lib/phoenix/sync/writer.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ defmodule Phoenix.Sync.Writer do
3232
user_id = conn.assigns.user_id
3333
3434
{:ok, txid, _changes} =
35-
#{inspect(__MODULE__)}.new()
36-
|> #{inspect(__MODULE__)}.allow(
35+
Writer.new()
36+
|> Writer.allow(
3737
Projects.Project,
3838
check: reject_invalid_params/2,
3939
load: &Projects.load_for_user(&1, user_id),
4040
validate: &Projects.Project.changeset/2
4141
)
42-
|> #{inspect(__MODULE__)}.allow(
42+
|> Writer.allow(
4343
Projects.Issue,
4444
# Use the sensible defaults:
4545
# validate: Projects.Issue.changeset/2
4646
# etc.
4747
)
48-
|> #{inspect(__MODULE__)}.apply(
48+
|> Writer.apply(
4949
transaction,
5050
Repo,
5151
format: Format.TanstackDB

0 commit comments

Comments
 (0)