Skip to content

Commit

Permalink
INTG-2300 Add API for fetching workspaces from proj
Browse files Browse the repository at this point in the history
  • Loading branch information
Juniverse committed Jan 9, 2025
1 parent 24c88dc commit ee6adab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Runtime/Scripts/Data/Entities/InworldProjectData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public class InworldProjectData
public List<WorkspaceInfo> workspaceInfo;
public List<UserShareInfo> ownerInfo;
public List<UserShareInfo> collaboratorInfo;

[JsonIgnore] public string DisplayName => name.Substring(name.LastIndexOf('/') + 1);

[JsonIgnore]
public List<string> WorkspaceList => workspaceInfo.Select(ws => ws.displayName).ToList();

}
[Serializable]
public class ListProjectResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public string ID
/// Get the workspace list by workspace full name.
/// </summary>
public List<string> WorkspaceList => m_Workspaces.Select(ws => ws.displayName).ToList();
public InworldProjectData GetProjectByDisplayName(string displayName) => m_Projects.FirstOrDefault(proj => proj.name.Contains(displayName));
/// <summary>
/// Get the workspace full name by its display name
/// </summary>
Expand Down

0 comments on commit ee6adab

Please sign in to comment.