- From the dashboard page of your project, click
Enable APIs and Services
- It should redirect you to the API Library page
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| case $- in | |
| *i*) ;; | |
| *) return;; | |
| esac |
Passing Arguments to Event Handlers) https://reactjs.org/docs/handling-events.html| /** | |
| Async/await and .then(data) are similar | |
| The only difference is async/await looks cleaner without the nested shit | |
| **/ | |
| // Async version | |
| // References: | |
| // https://devhints.io/es6 | |
| // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function |
| const Product = require('../models/product.model.js'); | |
| exports.create = (req, res) => { | |
| // Validation | |
| if (!req.body.name) { | |
| return res.status(400).send({ | |
| message: "Product name cannot be empty" | |
| }); | |
| } | |
| if (!req.body.categoryId) { |