mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: fix api param name (#20172)
In https://github.com/coder/coder/pull/20137, we added a new flag to `coder provisioner jobs list`, namely `--initiator`. To make some follow-up worth it, I need to rename an API param used in the process before it becomes part of our released and tagged API. Instead of only accepting UUIDs, we accept an arbitrary string. We still validate it as a UUID now, but we will expand its validation to allow any string and then resolve that string the same way that we resolve the user parameter elsewhere in the API.
This commit is contained in:
@@ -397,11 +397,11 @@ func (c *Client) OrganizationProvisionerDaemons(ctx context.Context, organizatio
|
||||
}
|
||||
|
||||
type OrganizationProvisionerJobsOptions struct {
|
||||
Limit int
|
||||
IDs []uuid.UUID
|
||||
Status []ProvisionerJobStatus
|
||||
Tags map[string]string
|
||||
InitiatorID *uuid.UUID
|
||||
Limit int
|
||||
IDs []uuid.UUID
|
||||
Status []ProvisionerJobStatus
|
||||
Tags map[string]string
|
||||
Initiator string
|
||||
}
|
||||
|
||||
func (c *Client) OrganizationProvisionerJobs(ctx context.Context, organizationID uuid.UUID, opts *OrganizationProvisionerJobsOptions) ([]ProvisionerJob, error) {
|
||||
@@ -423,8 +423,8 @@ func (c *Client) OrganizationProvisionerJobs(ctx context.Context, organizationID
|
||||
}
|
||||
qp.Add("tags", string(tagsRaw))
|
||||
}
|
||||
if opts.InitiatorID != nil {
|
||||
qp.Add("initiator_id", opts.InitiatorID.String())
|
||||
if opts.Initiator != "" {
|
||||
qp.Add("initiator", opts.Initiator)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user