Fix squad loading for issue assignees
This commit is contained in:
@@ -751,7 +751,7 @@ final class ApiClient {
|
|||||||
List<Models.Squad> squads(String workspaceId, boolean includeArchived) throws Exception {
|
List<Models.Squad> squads(String workspaceId, boolean includeArchived) throws Exception {
|
||||||
JSONObject query = query(null, "workspace_id", workspaceId);
|
JSONObject query = query(null, "workspace_id", workspaceId);
|
||||||
if (includeArchived) query.put("include_archived", "true");
|
if (includeArchived) query.put("include_archived", "true");
|
||||||
JSONObject json = requestObject("GET", "/api/squads", query, null);
|
JSONObject json = requestObject("GET", "/api/squads", query, null, workspaceIdHeaders(workspaceId));
|
||||||
return parseArray(extractArray(json, "squads"), Models.Squad::new);
|
return parseArray(extractArray(json, "squads"), Models.Squad::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1557,6 +1557,14 @@ final class ApiClient {
|
|||||||
throw new IllegalArgumentException("workspace_id is required. Select a workspace first.");
|
throw new IllegalArgumentException("workspace_id is required. Select a workspace first.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Map<String, String> workspaceIdHeaders(String workspaceId) {
|
||||||
|
String id = workspaceId == null ? "" : workspaceId.trim();
|
||||||
|
if (!id.isEmpty()) {
|
||||||
|
return Collections.singletonMap("X-Workspace-ID", id);
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("workspace_id is required. Select a workspace first.");
|
||||||
|
}
|
||||||
|
|
||||||
private static boolean isBlankQueryValue(Object value) {
|
private static boolean isBlankQueryValue(Object value) {
|
||||||
if (value == null || value == JSONObject.NULL) return true;
|
if (value == null || value == JSONObject.NULL) return true;
|
||||||
return String.valueOf(value).trim().isEmpty();
|
return String.valueOf(value).trim().isEmpty();
|
||||||
|
|||||||
@@ -6862,7 +6862,7 @@ private fun PilotIssueForm(
|
|||||||
projects = api.projects(session.workspace.id, 500, 0).items,
|
projects = api.projects(session.workspace.id, 500, 0).items,
|
||||||
members = api.members(session.workspace.id),
|
members = api.members(session.workspace.id),
|
||||||
agents = api.agents(session.workspace.id),
|
agents = api.agents(session.workspace.id),
|
||||||
squads = runCatching { api.squads(session.workspace.id) }.getOrElse { emptyList() },
|
squads = api.squads(session.workspace.id),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user