Skip to content

Commit f01abab

Browse files
committed
Update upgrade guide
1 parent 5c39fc8 commit f01abab

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

guides/upgrading/v0.15.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,31 @@ use Backpex.LiveResource,
5555
layout: &MyAppWeb.admin/1
5656
```
5757

58-
## Resource.update/6 has been changed
58+
## Resource and adapter functions have been updated
5959

60-
We no longer pass the `fields` to `Resource.update/6`. Therefore, the arity of this functions has changed to `Backpex.Resource.update/5`. This aligns the function `insert` and `update` of the Resource module.
60+
We've updated some functions in `Backpex.Resource` and the adapter modules (`Backpex.Adapters.Ecto` and `Backpex.Adapters.Ash`) to include the fields as an additional parameter.
61+
62+
The following functions are affected:
63+
64+
`Backpex.Resource`:
65+
- `list/3` -> `Backpex.Resource.list/4`
66+
- `count/3` -> `Backpex.Resource.count/4`
67+
- `get/3` -> `Backpex.Resource.get/4`
68+
- `get!/3` -> `Backpex.Resource.get!/4`
69+
70+
`Backpex.Adapter` (including `Backpex.Adapters.Ecto` and `Backpex.Adapters.Ash`):
71+
- `list/3` -> `c:Backpex.Adapter.list/4`
72+
- `count/3` -> `c:Backpex.Adapter.count/4`
73+
- `get/3` -> `c:Backpex.Adapter.get/4`
74+
75+
For example:
76+
77+
```elixir
78+
# before
79+
Resource.get(primary_value, socket.assigns, live_resource)
80+
# after
81+
Resource.get(primary_value, fields, socket.assigns, live_resource)
82+
```
6183

6284
## `:only`/`:except` field option changes
6385

0 commit comments

Comments
 (0)