Edits history of script submission #22351 for ' Delete Document (appwrite)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import { Client, Databases, ID } from "[email protected]";
    
    type Appwrite = {
      endpoint: string;
      project: string;
      key: string;
      self_signed: boolean;
    };
    export async function main(
      auth: Appwrite,
      database_id: string,
      collection_id: string,
      document_id: string,
    ) {
      const client = new Client()
        .setEndpoint(auth.endpoint)
        .setProject(auth.project)
        .setKey(auth.key);
      const db = new Databases(client);
    
      return await db.deleteDocument(database_id, collection_id, document_id);
    }
    

    Submitted by hugo989 1 day ago