Edits history of script submission #22476 for ' Get item list from a NocoDb table (nocodb)'

  • bunnative
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    
    type Nocodb = {
      apiUrl: string;
      xc_token: string;
      table: string;
      workspace: string;
    };
    export async function main(nocodb: Nocodb, limit: number) {
      // request from nocodb
      const res = await fetch(
        `${nocodb.apiUrl}/api/v1/db/data/v1/${nocodb.workspace}/${nocodb.table}?limit=${limit}`,
        {
          headers: {
            "Content-Type": "application/json",
            "xc-token": nocodb.xc_token,
          },
        },
      );
      const data = await res.json();
      return data;
    }
    

    Submitted by hugo989 5 days ago