import templateTransformer from "../../helpers/templateTransformer";
export default async function addTemplate(db, { data }) {
  const template = await templateTransformer(db, data);
  const newDoc = await db.add("templates", {
    ...template,
    createdAt: new Date(),
  });
  template.id = newDoc.id;
  return template;
}
