From afbef95592a9fe3dd2216620ddda982fe25ba25c Mon Sep 17 00:00:00 2001 From: fruitsnack1 Date: Thu, 13 Jun 2024 13:21:00 +0200 Subject: [PATCH] added correct return type to getItemNeighbors --- src/interfaces.ts | 5 +++++ src/model/item.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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,