Skip to content
Discussion options

You must be logged in to vote

You fetcher fn should be

const fetcher = async ([orgId, config]) => {
    const response = await fetch(
      `${process.env.NEXT_PUBLIC_APP_API_URL}/Admins/${orgId}`,
      config
    )
    if (!response.ok) {
      throw new Error('An error occurred while fetching the data.')
    }
    return response.json()
  }

https://swr.vercel.app/docs/typescript#useswr

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@desiboli
Comment options

Answer selected by promer94
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