Bulk delete all items in a NocoDb table

Script nocodb

by yassinsiouda74165 ยท 6/12/2023

  • Submitted by yassinsiouda74165 Deno
    Created 1071 days ago
    1
    import { Resource } from "https://deno.land/x/windmill/mod.ts";
    2
    export async function main(
    3
      nocodb: Resource<"nocodb">,
    4
    ) {
    5
      // create row in nocodb
    6
      const res = await fetch(`${nocodb.apiUrl}/api/v1/db/data/bulk/v1/${nocodb.workspace}/${nocodb.table}/all`, {
    7
        method: "DELETE",
    8
        headers: {
    9
          "Content-Type": "application/json",
    10
          "xc-token": nocodb.xc_token,
    11
        }
    12
      })
    13
      const data = await res.json()
    14
      return data
    15
    }