withAPIToken sets the old APIToken of the mutation.
(node *APIToken)
| 140 | |
| 141 | // withAPIToken sets the old APIToken of the mutation. |
| 142 | func withAPIToken(node *APIToken) apitokenOption { |
| 143 | return func(m *APITokenMutation) { |
| 144 | m.oldValue = func(context.Context) (*APIToken, error) { |
| 145 | return node, nil |
| 146 | } |
| 147 | m.id = &node.ID |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | // Client returns a new `ent.Client` from the mutation. If the mutation was |
| 152 | // executed in a transaction (ent.Tx), a transactional client is returned. |