1 | import { Client, Databases, ID } from "[email protected]"; |
2 |
|
3 | type Appwrite = { |
4 | endpoint: string; |
5 | project: string; |
6 | key: string; |
7 | self_signed: boolean; |
8 | }; |
9 | export async function main( |
10 | auth: Appwrite, |
11 | database_id: string, |
12 | collection_id: string, |
13 | document_id: string, |
14 | ) { |
15 | const client = new Client() |
16 | .setEndpoint(auth.endpoint) |
17 | .setProject(auth.project) |
18 | .setKey(auth.key); |
19 | const db = new Databases(client); |
20 |
|
21 | return await db.deleteDocument(database_id, collection_id, document_id); |
22 | } |
23 |
|