Update
client.vals.files.update(stringvalID, FileUpdateParams { path_, branch_id, content, 3 more } params, RequestOptionsoptions?): FileUpdateResponse { id, links, name, 4 more }
/v2/vals/{val_id}/files
Update a file's content
Parameters
valID: string
Returns
import ValTown from "npm:@valtown/sdk";
const client = new ValTown();
const file = await client.vals.files.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { path: 'path' });
console.log(file.id);
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"links": {
"html": "https://example.com",
"module": "https://example.com",
"self": "https://example.com",
"endpoint": "https://example.com"
},
"name": "name",
"path": "path",
"type": "directory",
"updatedAt": "2019-12-27T18:11:19.117Z",
"version": 0
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"links": {
"html": "https://example.com",
"module": "https://example.com",
"self": "https://example.com",
"endpoint": "https://example.com"
},
"name": "name",
"path": "path",
"type": "directory",
"updatedAt": "2019-12-27T18:11:19.117Z",
"version": 0
}