1 | import * as sdk from "https://deno.land/x/[email protected]/mod.ts"; |
2 | import type { Resource } from "https://deno.land/x/[email protected]/mod.ts"; |
3 |
|
4 | export async function main( |
5 | auth: Resource<"appwrite">, |
6 | collectionId: string, |
7 | databaseId: string, |
8 | documentId: string |
9 | ) |
10 | { |
11 | |
12 | let client = new sdk.Client(); |
13 | client |
14 | .setEndpoint(auth.endpoint) |
15 | .setProject(auth.project) |
16 | .setKey(auth.key) |
17 |
|
18 | const databases = new sdk.Databases(client); |
19 |
|
20 | |
21 | return await databases.deleteDocument |
22 | ( |
23 | databaseId, |
24 | collectionId, |
25 | documentId |
26 | ) |
27 | } |
28 |
|