Skip to content

Instantly share code, notes, and snippets.

View abhiaiyer91's full-sized avatar

Abhi Aiyer abhiaiyer91

  • Netlify
  • Los Angeles
View GitHub Profile
DEBUG: yarn.lock needs updating (repository=julienp-test-org/gatsby-starter-blog, branch=renovate/react-helmet-6.x)
DEBUG: Updated 2 lock files (repository=julienp-test-org/gatsby-starter-blog, branch=renovate/react-helmet-6.x)
"updatedArtifacts": ["package-lock.json", "yarn.lock"]
DEBUG: 3 file(s) to commit (repository=julienp-test-org/gatsby-starter-blog, branch=renovate/react-helmet-6.x)
DEBUG: Committing files to branch renovate/react-helmet-6.x (repository=julienp-test-org/gatsby-starter-blog, branch=renovate/react-helmet-6.x)
DEBUG: Error commiting files (repository=julienp-test-org/gatsby-starter-blog, branch=renovate/react-helmet-6.x)
"err": {
"task": {
"commands": [
"push",
module.exports = {
/* endpoint: 'https://api.github.com/', */
token: 'xxx',
platform: 'github',
logLevel: 'debug',
onboardingConfig: {
extends: ['config:base'],
},
repositories: ['julienp-test-org/gatsby-starter-blog'],
renovateFork: true,
// You're hosting an event, and the admission tickets are expensive. Groups of people are trying to cheat the system by using the same tickets multiple times. Stop them!
// 1) Create a constructor function called Ticket that takes one parameter, code, and creates a Ticket object.
// The Ticket object will have the following parameters:
// code : a string that stores the ticket code
// used : a boolean that stores whether or not the ticket has been used yet
// useTicket: a function registers that the ticket has been used and prevents reuse or tampering
// 2) Create a function called validTicket to check whether the ticket is valid and return true or false. For a ticket to be valid,
// the ticket code must match the correct code, and the ticket must be unused.
// Print out the grade-school multiplication table up to 12x12
function multiplicationTable(maxValue) {
for (var i = 1; i <= maxValue; i++) {
let line
for (var j = 1; j <= maxValue; j++) {
line = line + ` ${j * i}`;
}
console.log(line)
}
/** rest of code above **/
server.get("/post/:id", async (req, res) => {
const postId = req.params.id;
// Use the post API from prisma client
try {
const post = await prisma.post({
id: postId
});
const author = await prisma
/** rest of code above **/
server.get("/posts", async (_req, res) => {
// Use the posts API from prisma client
try {
const posts = await prisma.posts({
where: {
published: true
}
});
/** rest of code above **/
server.get("/post/:id", async (req, res) => {
const postId = req.params.id;
// Use the post API from prisma client
try {
const post = await prisma.post({
id: postId
});
/** rest of code above **/
server.post("/post/publish/:id", async (req, res) => {
const postId = req.params.id;
// Use the updatePost API from prisma client
try {
const publishedPost = await prisma.updatePost({
where: {
id: postId
},
/** rest of code above **/
server.post("/create/draft", async (req, res) => {
const { title, authorId } = req.body;
// Use the createPost API from prisma client
try {
const draftPost = await prisma.createPost({
title,
author: {
connect: {
/** rest of code above **/
server.get("/user/:id", async (req, res) => {
const userId = req.params.id;
// Use the user API from prisma client
try {
const user = await prisma.user({
id: userId
});