2023-02-05 19:15:20 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Settings::SharingController < ApplicationController
|
|
|
|
before_action :authenticate_user!
|
|
|
|
|
|
|
|
def edit; end
|
|
|
|
|
|
|
|
def update
|
|
|
|
user_attributes = params.require(:user).permit(:sharing_enabled,
|
|
|
|
:sharing_autoclose,
|
|
|
|
:sharing_custom_url)
|
|
|
|
if current_user.update(user_attributes)
|
2023-02-10 20:48:15 +01:00
|
|
|
flash.now[:success] = t(".success")
|
2023-02-05 19:15:20 +01:00
|
|
|
else
|
2023-02-10 20:48:15 +01:00
|
|
|
flash.now[:error] = t(".error")
|
2023-02-05 19:15:20 +01:00
|
|
|
end
|
2023-02-10 20:48:15 +01:00
|
|
|
|
|
|
|
render :edit
|
2023-02-05 19:15:20 +01:00
|
|
|
end
|
|
|
|
end
|