Notice

Authentication and Validation is required for Delete operations.

Warning

Delete is an irreversible and destructive process that removes data from the Plattar API. Some object hierarchies/relationships will no longer function depending on what has been deleted.

Delete request will reach out to the Plattar API and delete the current object. Any further requests to the object will throw an error.

Perform a .delete() operation
This example shows how to delete an existing Project
const {
	Project,
  	Server
} = require('@plattar/plattar-api');

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

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

// .delete() is a destructive process that will delete this
// object from the Plattar API
project.delete().then((proj) => {
	// The proj will be supplied however it no longer exists
	// in the Plattar API and should not be used
}).catch((error) => {
	// delete failed. This can happen if the object has already
	// been deleted or the object doesn't exist
	console.error(error);
});