Skip to content

Commit 0e02e75

Browse files
committed
chore: credo
1 parent a50a4ba commit 0e02e75

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

documentation/dsls/DSL-AshPhoenix.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,65 @@ MyApp.Accounts.form_to_update_user(params: %{"email" => "placeholder@email"})
5656
```
5757

5858

59+
## forms
60+
Customize the definition of forms for code interfaces
61+
62+
### Nested DSLs
63+
* [form](#forms-form)
64+
65+
66+
### Examples
67+
```
68+
forms do
69+
# customize the generated `form_to_create_student` function
70+
form :create_student, args: [:school_id]
71+
end
72+
73+
```
74+
75+
76+
77+
78+
### forms.form
79+
```elixir
80+
form name
81+
```
82+
83+
84+
Customize the definition of a form for a code inteface
85+
86+
87+
88+
### Examples
89+
```
90+
# customize the generated `form_to_create_student` function
91+
# args defaults to empty for form definitions
92+
form :create_student, args: [:school_id]
93+
94+
```
95+
96+
97+
98+
### Arguments
99+
100+
| Name | Type | Default | Docs |
101+
|------|------|---------|------|
102+
| [`name`](#forms-form-name){: #forms-form-name } | `atom` | | The name of the interface to modify. Must match an existing interface definition. |
103+
### Options
104+
105+
| Name | Type | Default | Docs |
106+
|------|------|---------|------|
107+
| [`args`](#forms-form-args){: #forms-form-args } | `list(atom \| {:optional, atom})` | | Map specific arguments to named inputs. Can provide any argument/attributes that the action allows. |
108+
109+
110+
111+
112+
113+
### Introspection
114+
115+
Target: `AshPhoenix.FormDefinition`
116+
117+
59118

60119

61120

lib/ash_phoenix.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ defmodule AshPhoenix do
5454
"""
5555

5656
defmodule FormDefinition do
57+
@moduledoc "A customized form code interface"
5758
defstruct [:name, :args]
5859
end
5960

lib/ash_phoenix/helpers.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
defmodule AshPhoenix.Helpers do
2+
@moduledoc false
23
def get_subdomain(%Plug.Conn{host: host}, endpoint) when is_atom(endpoint) do
34
get_subdomain(host, endpoint)
45
end

lib/verifiers/verify_form_definitions.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
defmodule AshPhoenix.Verifiers.VerifyFormDefinitions do
2+
@moduledoc false
23
use Spark.Dsl.Verifier
34

45
def verify(dsl) do

0 commit comments

Comments
 (0)