2018-10-26 08:49:16 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Boards
|
|
|
|
module Visits
|
|
|
|
class CreateService < Boards::BaseService
|
|
|
|
def execute(board)
|
|
|
|
return unless current_user && Gitlab::Database.read_write?
|
2021-05-11 02:10:29 -04:00
|
|
|
return unless board.is_a?(Board) # other board types do not support board visits yet
|
2018-10-26 08:49:16 -04:00
|
|
|
|
2021-05-11 02:10:29 -04:00
|
|
|
if parent.is_a?(Group)
|
|
|
|
BoardGroupRecentVisit.visited!(current_user, board)
|
|
|
|
else
|
|
|
|
BoardProjectRecentVisit.visited!(current_user, board)
|
|
|
|
end
|
2018-10-26 08:49:16 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|