mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-19 08:52:25 +01:00
(bug) cant load order withdrawal instructions if no login
This commit is contained in:
parent
ef3b876bd0
commit
9834faf120
@ -3,7 +3,7 @@
|
||||
# API Controller for resources of type Order
|
||||
# Orders are used in store
|
||||
class API::OrdersController < API::ApiController
|
||||
before_action :authenticate_user!
|
||||
before_action :authenticate_user!, except: %i[withdrawal_instructions]
|
||||
before_action :set_order, only: %i[show update destroy withdrawal_instructions]
|
||||
|
||||
def index
|
||||
|
@ -15,6 +15,6 @@ class OrderPolicy < ApplicationPolicy
|
||||
end
|
||||
|
||||
def withdrawal_instructions?
|
||||
user.privileged? || (record&.statistic_profile_id == user.statistic_profile.id)
|
||||
user&.privileged? || (record&.statistic_profile_id == user&.statistic_profile&.id)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user