fix(workspaces): stop filtering server list by active workspace in assignment dialog

The workspace edit dialog reused useServers(), which always sends the
X-Active-Workspace header, so admins assigning servers to a workspace
only ever saw servers already in the currently active workspace instead
of the full list. apiClient now lets a caller override the header, and
useServers(allWorkspaces) requests '0' (admin "show all") for that dialog.
This commit is contained in:
markmorado
2026-07-23 21:59:02 +05:00
parent ef5b40b2f7
commit 203ae8bdd6
3 changed files with 19 additions and 9 deletions

View File

@@ -134,7 +134,9 @@ function EditWorkspaceDialog({
const [description, setDescription] = useState(initialDescription);
const { data: workspace } = useWorkspace(workspaceId);
const { data: allServers = [] } = useServers();
// allWorkspaces: этот диалог назначает серверы рабочей области, поэтому
// список не должен фильтроваться заголовком активной рабочей области.
const { data: allServers = [] } = useServers({ allWorkspaces: true });
const { data: allUsers = [] } = useUsers();
const updateServers = useUpdateWorkspaceServers();
const updateUsers = useUpdateWorkspaceUsers();