1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-12 23:09:03 +01:00
fab-manager/app/views/api/spaces/index.json.jbuilder

17 lines
334 B
Plaintext
Raw Normal View History

2021-12-21 09:51:40 +01:00
# frozen_string_literal: true
2017-02-13 16:10:12 +01:00
json.array!(@spaces) do |space|
2022-11-08 16:20:34 +01:00
json.partial! 'api/spaces/space', space: space
2023-07-28 16:16:44 +02:00
parent = @spaces_indexed_with_parent[space]
if parent
json.parent do
json.name parent.name
end
end
json.children @spaces_grouped_by_parent_id[space.id] do |child|
json.name child.name
end
2017-02-13 16:10:12 +01:00
end