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 | databaseId: string, |
7 | collectionId: string, |
8 | documentId: string, |
9 | data: object, |
10 | ) |
11 | { |
12 |
|
13 | console.log("data to update"); |
14 | console.log(data); |
15 | let client = new sdk.Client(); |
16 | client |
17 | .setEndpoint(auth.endpoint) |
18 | .setProject(auth.project) |
19 | .setKey(auth.key) |
20 |
|
21 | const databases = new sdk.Databases(client); |
22 |
|
23 | return await databases.updateDocument |
24 | ( |
25 | databaseId, |
26 | collectionId, |
27 | documentId, |
28 | data |
29 | ) |
30 | } |
31 |
|