Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Looking for e.g. useGet, consuming one GET endpoint without an id #6671

Answered by BatuhanW
thraizz asked this question in Q&A
Discussion options

Hi!
I have a simple GET /config endpoint I want to consume and display. I cannot find the right hook to use for this, though.
useList is for getting multiple values.
useOne is for getting one specific value of many values.

Is there nothing for just getting a resource?

You must be logged in to vote

Hello @thraizz you can use useOne hook and pass empty string to id field id: "".

Replies: 1 comment 2 replies

Comment options

Hello @thraizz you can use useOne hook and pass empty string to id field id: "".

You must be logged in to vote
2 replies
Comment options

I see! I tried null or undefined before lol 😅

Comment options

We want to change that in the future. It's confusing 😅

Answer selected by thraizz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /