import * as sdk from "https://deno.land/x/[email protected]/mod.ts";
import type { Resource } from "https://deno.land/x/[email protected]/mod.ts";
export async function main(
auth: Resource<"appwrite">,
databaseId: string,
collectionId: string,
documentId: string,
data: object,
)
{
console.log("data to update");
console.log(data);
let client = new sdk.Client();
client
.setEndpoint(auth.endpoint) // Your API Endpoint
.setProject(auth.project) // Your project ID
.setKey(auth.key) // Your secret API key
const databases = new sdk.Databases(client);
return await databases.updateDocument
(
databaseId,
collectionId,
documentId,
data
)
}
Submitted by said30 1227 days ago