diff --git a/src/interfaces.ts b/src/interfaces.ts index 239c6ef..7809da8 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -22,6 +22,11 @@ export interface PopularOutput { Score: number; } +export interface SimilarOutput { + Id: string; + Score: number; +} + export interface PopularOptions { category?: string; cursorOptions?: OffsetCursorOptions; diff --git a/src/model/item.ts b/src/model/item.ts index 24ada3e..ec22e0c 100644 --- a/src/model/item.ts +++ b/src/model/item.ts @@ -5,6 +5,7 @@ import { Item, ItemCursor, ItemNeighborsOptions, + SimilarOutput, } from "../interfaces"; export function upsertItem(axios: AxiosInstance, itemData: Item) { @@ -94,7 +95,7 @@ export function getItemNeighbors( { itemId, category = "", cursorOptions }: ItemNeighborsOptions ) { return axios - .get>( + .get>( `/item/${itemId}/neighbors/${category}`, { params: cursorOptions,