Sha256: 86ca815956672850378a475b4b77e18db92acbd3d822929a304e5e59d8cc753e
Contents?: true
Size: 592 Bytes
Versions: 16
Compression:
Stored size: 592 Bytes
Contents
module ForestLiana class DeviseController < ForestLiana::ApplicationController def change_password resource = SchemaUtils.find_model_from_table_name( params.dig('data', 'attributes', 'collection_name')) user = resource.find(params.dig('data', 'attributes', 'ids').first) user.password = params.dig('data', 'attributes', 'values', 'New password') user.save if user.valid? head :no_content else render status: 400, json: { error: user.errors.try(:messages).try(:[], :password) } end end end end
Version data entries
16 entries across 16 versions & 1 rubygems