Skip to content

Commit

Permalink
fix: remove read items of user in GetItemNeighbors and GetItemNeighbo…
Browse files Browse the repository at this point in the history
…rsWithCategory methods of GorseClient (#810)
  • Loading branch information
resulshm authored Mar 12, 2024
1 parent 04f8767 commit e9a80e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ func (c *GorseClient) GetUserNeighbors(ctx context.Context, userId string, n, of
return request[[]Score, any](ctx, c, "GET", c.entryPoint+fmt.Sprintf("/api/user/%s/neighbors?n=%d&offset=%d", userId, n, offset), nil)
}

func (c *GorseClient) GetItemNeighbors(ctx context.Context, itemId string, n, offset int) ([]Score, error) {
return request[[]Score, any](ctx, c, "GET", c.entryPoint+fmt.Sprintf("/api/item/%s/neighbors?n=%d&offset=%d", itemId, n, offset), nil)
func (c *GorseClient) GetItemNeighbors(ctx context.Context, itemId, userId string, n, offset int) ([]Score, error) {
return request[[]Score, any](ctx, c, "GET", c.entryPoint+fmt.Sprintf("/api/item/%s/neighbors?n=%d&offset=%d&user-id=%s", itemId, n, offset, userId), nil)
}

func (c *GorseClient) GetItemNeighborsWithCategory(ctx context.Context, itemId, category string, n, offset int) ([]Score, error) {
return request[[]Score, any](ctx, c, "GET", c.entryPoint+fmt.Sprintf("/api/item/%s/neighbors/%s?n=%d&offset=%d", itemId, category, n, offset), nil)
func (c *GorseClient) GetItemNeighborsWithCategory(ctx context.Context, itemId, category, userId string, n, offset int) ([]Score, error) {
return request[[]Score, any](ctx, c, "GET", c.entryPoint+fmt.Sprintf("/api/item/%s/neighbors/%s?n=%d&offset=%d&user-id=%s", itemId, category, n, offset, userId), nil)
}

// Deprecated: GetItemNeighbors instead
Expand Down

0 comments on commit e9a80e5

Please sign in to comment.