torus-digital / torus_cms

An open source serverless content management system and static page generator
http://toruscms.org
MIT License
33 stars 3 forks source link

Delete functionality - Articles #57

Closed gkpty closed 5 years ago

gkpty commented 5 years ago

basic delete functionality for articles. will display an alert before permanently deleting and then un-publishing the article.

gkpty commented 5 years ago

//Delete Mutation

input DeletePostInput {
    id: ID
}
gkpty commented 5 years ago

//Remove from storage

Storage.remove('test.txt')
    .then(result => console.log(result))
    .catch(err => console.log(err));
gkpty commented 5 years ago

//Delete from public s3 bucket (AWS-SDK-JS)

/ The following example deletes an object from an S3 bucket. /

var params = {
  Bucket: "examplebucket", 
  Key: "objectkey.jpg"
 };
 s3.deleteObject(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });