Skip to content

Instantly share code, notes, and snippets.

@ktutnik
Last active May 3, 2021 20:35
Show Gist options
  • Save ktutnik/6609638158071d85aab4591e2e38d180 to your computer and use it in GitHub Desktop.
Save ktutnik/6609638158071d85aab4591e2e38d180 to your computer and use it in GitHub Desktop.
import { GenericController } from "@plumier/typeorm"
import { Context } from "koa"
export class ProductsController extends GenericController(Product) {
// override save method (POST /path)
save(data: Product, ctx: Context) {
// add your custom logic here
const result = super.save(data, ctx)
// add your custom logic here
return result
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment