19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/monban/use_case/account/change/password.rb', line 19
def change(params)
Getto::Params.new.validate(params) do |v|
v.hash(
account_id: v.integer{|val| param_error!(account_id: val) },
password: v.combine([v.string, v.not_empty]), )
end or param_error!(params: "FILTERED")
repository.transaction do
unless repository.account_exists?(account_id: params[:account_id])
error.not_found! "account_id: #{params[:account_id]}"
end
self.password.change(
account_id: params[:account_id],
password: params[:password],
)
end
nil
end
|