Skip to content

Refactor Fetch #2

@shalluv

Description

@shalluv

Seem like there are a lot of repetition of

const response = await fetch(
    `${process.env.NOCODB_BASE_URL}/api/v2/...`,
    {
      headers: {
        'xc-token': process.env.NOCODB_XC_TOKEN ?? '',
      },
      next: { revalidate: 60 },
    }
  )

Can we create a function fetcher or something to handle them?
Additionally, please move functions inside this file to separate files since right now file name does not match function inside.

Also, if you want to use external lib, it's fine but please start a thread in discord first.

Originally posted by @shalluv in #1 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions