import models from "../models";

export default async (id, reply) => {
  models.then(model => {
    model.Post
      .destroy({
        where: {
          id: id
        }
      })
      .then(record => {
        return reply().redirect(`/dashboard`);
      });
  });
};
