mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: scope workspace quotas to organizations (#14352)
* chore: scope workspace quotas to organizations Quotas are now a function of (user_id, organization_id). They are still sourced from groups. Deprecate the old api endpoint.
This commit is contained in:
@@ -572,8 +572,8 @@ type WorkspaceQuota struct {
|
||||
Budget int `json:"budget"`
|
||||
}
|
||||
|
||||
func (c *Client) WorkspaceQuota(ctx context.Context, userID string) (WorkspaceQuota, error) {
|
||||
res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/workspace-quota/%s", userID), nil)
|
||||
func (c *Client) WorkspaceQuota(ctx context.Context, organizationID string, userID string) (WorkspaceQuota, error) {
|
||||
res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/organizations/%s/members/%s/workspace-quota", organizationID, userID), nil)
|
||||
if err != nil {
|
||||
return WorkspaceQuota{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user