Notice

Authentication and Validation is required for Update operations.

Warning

Update is an irreversible and destructive process that overrides/changes data in the Plattar API.

Update request will reach out to the Plattar API and update the object with whatever is in the current .attributes fields.

Perform an .update() operation
This example shows how to fetch Project data with the provided ID and update some data
const {
	Project,
  	Server
} = require('@plattar/plattar-api');

Server.default().auth(process.env.PLATTAR_AUTH_TOKEN);

const project = new Project('your-project-id');

proj.attributes.title = 'Your New Project Title';

// .update() function will write the new attributes
// back into the Plattar API
proj.update().then((proj) => {
  	// do something with proj
}).catch((error) => {
  	console.error(error);
});