CardSlider

Plattar API cardslider Reference

Parent
Relationships
Imports
NodeJS Imports
const {
  	Page,
  	CardSlider,
  	Server
} = require('@plattar/plattar-api');
Initialisation
Initialise the CardSlider Object
const slider = new CardSlider('your-card-slider-id');
.get()
Populate the object with data
slider.get().then((slider) => {
	// do something with slider
}).catch((error) => {
	// do something with error
});
.update()
Update the object with new data
Server.default().auth(process.env.PLATTAR_AUTH_TOKEN);

slider.attributes.title = 'your-new-card-slider-title';

slider.update().then((slider) => {
	// do something with slider
}).catch((error) => {
	// do something with error
});
.create()
Create a new object
Server.default().auth(process.env.PLATTAR_AUTH_TOKEN);

slider.attributes.title = 'your-new-card-slider-title';

// you must pass the parent object during create function
const parent = new Page('your-page-id');

slider.create(parent).then((slider) => {
	// do something with slider
}).catch((error) => {
	// do something with error
});
.delete()
Delete a previous object
Server.default().auth(process.env.PLATTAR_AUTH_TOKEN);

slider.delete().then((slider) => {
	// do something with slider
}).catch((error) => {
	// do something with error
});