fix(http): remove id param for /buckets and update swagger (#1942)
parent
4e7f89d6a1
commit
909fb6e98c
|
|
@ -390,14 +390,6 @@ func decodeGetBucketsRequest(ctx context.Context, r *http.Request) (*getBucketsR
|
|||
req.filter.Organization = &org
|
||||
}
|
||||
|
||||
if bucketID := qp.Get("id"); bucketID != "" {
|
||||
id, err := platform.IDFromString(bucketID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.filter.ID = id
|
||||
}
|
||||
|
||||
if name := qp.Get("name"); name != "" {
|
||||
req.filter.Name = &name
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2396,8 +2396,17 @@ paths:
|
|||
parameters:
|
||||
- in: query
|
||||
name: org
|
||||
description: specifies the organization of the resource
|
||||
required: true
|
||||
description: specifies the organization name of the resource
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: orgID
|
||||
description: specifies the organization id of the resource
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: name
|
||||
description: only returns buckets with the specified name
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
|
|
|
|||
|
|
@ -626,42 +626,6 @@ func FindBuckets(
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "find bucket by id",
|
||||
fields: BucketFields{
|
||||
Organizations: []*platform.Organization{
|
||||
{
|
||||
Name: "theorg",
|
||||
ID: MustIDBase16(orgOneID),
|
||||
},
|
||||
},
|
||||
Buckets: []*platform.Bucket{
|
||||
{
|
||||
ID: MustIDBase16(bucketOneID),
|
||||
OrganizationID: MustIDBase16(orgOneID),
|
||||
Name: "abc",
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(bucketTwoID),
|
||||
OrganizationID: MustIDBase16(orgOneID),
|
||||
Name: "xyz",
|
||||
},
|
||||
},
|
||||
},
|
||||
args: args{
|
||||
ID: MustIDBase16(bucketTwoID),
|
||||
},
|
||||
wants: wants{
|
||||
buckets: []*platform.Bucket{
|
||||
{
|
||||
ID: MustIDBase16(bucketTwoID),
|
||||
OrganizationID: MustIDBase16(orgOneID),
|
||||
Organization: "theorg",
|
||||
Name: "xyz",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "find bucket by name",
|
||||
fields: BucketFields{
|
||||
|
|
|
|||
Loading…
Reference in New Issue