Skip to content

Commit 0f634b2

Browse files
committed
chore(gobright/LocationServices): rename desk .groups to .departments to avoid conflict with existing FE feature
1 parent 70f917d commit 0f634b2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

drivers/gobright/location_service.cr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,21 @@ class GoBright::LocationService < PlaceOS::Driver
157157
spaces[space.id] = space.dup
158158
end
159159

160-
# retrieve desk details and perform gobright_desk_name to groups mapping
160+
# retrieve desk details and perform gobright_desk_name to departments (groups) mapping
161161
desks_meta = staff_api.metadata(zone_id, "desks").get.as_h["desks"].as_h
162162
desk_groups_mapping = desks_meta["details"].as_a.map do |desk|
163163
desk_h = desk.as_h
164164
gobright_desk_name = desk_h["gobright_desk_name"].as_s
165-
groups = begin
166-
if (arr = desk_h["groups"].as_a?)
165+
departments = begin
166+
if (arr = desk_h["departments"].as_a?)
167167
arr.empty? ? ["none"] : arr.map(&.as_s)
168-
elsif desk_h.has_key?("groups") && desk_h["groups"].raw.is_a?(String)
169-
[desk_h.["groups"].as_s]
168+
elsif desk_h.has_key?("departments") && desk_h["departments"].raw.is_a?(String)
169+
[desk_h["departments"].as_s]
170170
else
171171
["none"]
172172
end
173173
end
174-
{gobright_desk_name, groups}
174+
{gobright_desk_name, departments}
175175
end.to_h
176176

177177
# mark if the space is occupied

drivers/gobright/location_service_spec.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class StaffAPIMock < DriverSpecs::MockDriver
9595
{
9696
"id": "table-07.001.status",
9797
"name": "Desk 07.001",
98-
"groups": ["HR"],
98+
"departments": ["HR"],
9999
"map_id": "table-07.001.status",
100100
"bookable": true,
101101
"gobright_desk_name": "desk-1",

0 commit comments

Comments
 (0)