{"size": 504, "ext": "js", "max_stars_repo_path": "api/src/services/authors/authors.js", "max_stars_repo_name": "sitepoint-editors/getting-started-redwood-js", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "api/src/services/authors/authors.js", "max_issues_repo_name": "sitepoint-editors/getting-started-redwood-js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "api/src/services/authors/authors.js", "max_forks_repo_name": "sitepoint-editors/getting-started-redwood-js", "max_forks_repo_forks_event_min_datetime": "2020-12-18T08:37:30.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-18T08:37:30.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 16.2580645161, "max_line_length": 48, "alphanum_fraction": 0.5595238095}
import { db } from 'src/lib/db'

export const authors = () => {
  return db.author.findMany()
}

export const author = ({ id }) => {
  return db.author.findOne({
    where: { id },
  })
}

export const createAuthor = ({ input }) => {
  return db.author.create({
    data: input,
  })
}

export const updateAuthor = ({ id, input }) => {
  return db.author.update({
    data: input,
    where: { id },
  })
}

export const deleteAuthor = ({ id }) => {
  return db.author.delete({
    where: { id },
  })
}
