Created
August 7, 2021 10:55
-
-
Save MariusBongarts/3e8f49b40cf114f2a2d58cab12ebc2fb to your computer and use it in GitHub Desktop.
DRY - Create
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async create(user: User, product: Product): Promise<Product | undefined> { | |
if (userIsPermitted(user)) { | |
console.log(`Create product.`); | |
return this.db.create({user, product}); | |
} | |
return undefined; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment