Merge pull request #2791 from betagouv/remove-facade
Remove InviteDossierFacades
This commit is contained in:
commit
a5f71bfaf6
2 changed files with 5 additions and 10 deletions
|
@ -10,12 +10,13 @@ class Users::Dossiers::InvitesController < UsersController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@facade = InviteDossierFacades.new params[:id].to_i, current_user.email
|
invite = Invite.where(email: current_user.email, id: params[:id].to_i).first!
|
||||||
|
dossier = invite.dossier
|
||||||
|
|
||||||
if @facade.dossier.brouillon?
|
if dossier.brouillon?
|
||||||
redirect_to brouillon_dossier_path(@facade.dossier)
|
redirect_to brouillon_dossier_path(dossier)
|
||||||
else
|
else
|
||||||
return redirect_to dossier_path(@facade.dossier)
|
return redirect_to dossier_path(dossier)
|
||||||
end
|
end
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
flash.alert = t('errors.messages.dossier_not_found')
|
flash.alert = t('errors.messages.dossier_not_found')
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
class InviteDossierFacades < DossierFacades
|
|
||||||
# TODO rechercher en fonction de la personne/email
|
|
||||||
def initialize(id, email)
|
|
||||||
@dossier = Invite.where(email: email, id: id).first!.dossier
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in a new issue