@@ -19,20 +19,20 @@ defmodule Backpex.Resource do
19
19
search: {"hello", [:title, :description]}
20
20
]
21
21
"""
22
- def list ( criteria , assigns , live_resource , fields ) do
22
+ def list ( criteria , fields , assigns , live_resource ) do
23
23
adapter = live_resource . config ( :adapter )
24
24
25
- adapter . list ( criteria , assigns , live_resource , fields )
25
+ adapter . list ( criteria , fields , assigns , live_resource )
26
26
end
27
27
28
28
@ doc """
29
29
Gets the total count of the current live_resource.
30
30
Possibly being constrained the item query and the search- and filter options.
31
31
"""
32
- def count ( criteria , assigns , live_resource , fields ) do
32
+ def count ( criteria , fields , assigns , live_resource ) do
33
33
adapter = live_resource . config ( :adapter )
34
34
35
- adapter . count ( criteria , assigns , live_resource , fields )
35
+ adapter . count ( criteria , fields , assigns , live_resource )
36
36
end
37
37
38
38
@ doc """
@@ -46,17 +46,17 @@ defmodule Backpex.Resource do
46
46
* `assigns` (map): The current assigns of the socket.
47
47
* `live_resource` (module): The `Backpex.LiveResource` module.
48
48
"""
49
- def get ( primary_value , assigns , live_resource , fields ) do
49
+ def get ( primary_value , fields , assigns , live_resource ) do
50
50
adapter = live_resource . config ( :adapter )
51
51
52
- adapter . get ( primary_value , assigns , live_resource , fields )
52
+ adapter . get ( primary_value , fields , assigns , live_resource )
53
53
end
54
54
55
55
@ doc """
56
56
Same as `get/4` but returns the result or raises an error.
57
57
"""
58
- def get! ( primary_value , assigns , live_resource , fields ) do
59
- case get ( primary_value , assigns , live_resource , fields ) do
58
+ def get! ( primary_value , fields , assigns , live_resource ) do
59
+ case get ( primary_value , fields , assigns , live_resource ) do
60
60
{ :ok , nil } -> raise Backpex.NoResultsError
61
61
{ :ok , result } -> result
62
62
{ :error , _error } -> raise Backpex.NoResultsError
@@ -92,7 +92,7 @@ defmodule Backpex.Resource do
92
92
* `attrs` (map): A map of parameters that will be passed to the `changeset_function`.
93
93
* TODO: docs
94
94
"""
95
- def insert ( item , attrs , assigns , live_resource , fields , opts ) do
95
+ def insert ( item , attrs , fields , assigns , live_resource , opts ) do
96
96
{ after_save_fun , opts } = Keyword . pop ( opts , :after_save_fun , & { :ok , & 1 } )
97
97
98
98
adapter = live_resource . config ( :adapter )
@@ -113,7 +113,7 @@ defmodule Backpex.Resource do
113
113
* `attrs` (map): A map of parameters that will be passed to the `changeset_function`.
114
114
* TODO: docs
115
115
"""
116
- def update ( item , attrs , assigns , fields , live_resource , opts \\ [ ] ) do
116
+ def update ( item , attrs , fields , assigns , live_resource , opts \\ [ ] ) do
117
117
{ after_save_fun , opts } = Keyword . pop ( opts , :after_save_fun , & { :ok , & 1 } )
118
118
119
119
adapter = live_resource . config ( :adapter )
0 commit comments