#community-help

Issue with Typesense-JS Library and Return Value Types

TLDR Adam asked for help with a return value discrepancy in a typescript project. Jason confirmed the issue and recommended submitting a GitHub issue. A link to the issue was provided.

Powered by Struct AI
7
7mo
Solved
Join the chat
Feb 14, 2023 (7 months ago)
Adam
Photo of md5-d1ca9f479dc9860becc380edf02d7689
Adam
03:19 PM
hi everyone - I’m working on a project with nextJS/typescript and the typesense-js library and have a question about the return value of the client.collections().update() call. typescript says that the return value of update is of type CollectionSchema. however, it looks like what actually comes back from the promise is either a CollectionFieldSchema or CollectionUpdateFieldSchema . I can submit an issue to github, but I wanted to check if I was missing something obvious first. further details added in a thread
03:19
Adam
03:19 PM
what typescript thinks the return value of update is
Image 1 for what typescript thinks the return value of <code>update</code> is
03:20
Adam
03:20 PM
code snippet from my project
03:21
Adam
03:21 PM
response from the server
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:21 PM
Ah hmm, yeah that’s an oversight. A GitHub issue would be great
Adam
Photo of md5-d1ca9f479dc9860becc380edf02d7689
Adam
04:21 PM
you bet. thanks very much!
04:35
Adam
04:35 PM
thanks for your help with this 🙂 https://github.com/typesense/typesense-js/issues/150