What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-18 20:22:07
nestjs typeorm update entity
import { Injectable } from '@nestjs/common'; import { Todo } from './todo.entity'; import { Repository, DeleteResult } from 'typeorm'; import { InjectRepository } from '@nestjs/typeorm'; import { CreateTodoDto } from './todos.dto'; @Injectable() export c... Add solution -
Javascript 2021-09-18 15:54:01
promises in javascript
/* A Promise is a proxy for a value not necessarily known when the promise is created. It allows you to associate handlers with an asynchronous action's eventual success value or failure reason. */ let promise = new Promise((resolve... Add solution -
Javascript 2021-09-18 10:25:06
vanilla js post form data
document.addEventListener('submit', function (event) { event.preventDefault(); fetch('https://jsonplaceholder.typicode.com/posts', { method: 'POST', body: JSON.stringify(Object.fromEntries(new FormData(event.target))), headers: { 'Content-typ... Add solution -
Javascript 2021-09-17 23:50:04
gatsby creating pages from contentful
const path = require('path') exports.createPages = ({graphql, boundActionCreators}) => { const {createPage} = boundActionCreators return new Promise((resolve, reject) => { const storeTemplate = path.resolve('src/templates/store.js') res... Add solution -
Other 2021-09-17 03:45:02
aws amplify cli set environment variable
const aws = require('aws-sdk'); exports.handler = async () => { const { Parameters } = await (new aws.SSM()) .getParameters({ Names: ["SECRET_TOKEN"].map(secretName => process.env[secretName]), WithDecryption: true, ... Add solution -
Other 2021-09-17 00:44:04
koa-router 404 not found
async getMessages(ctx) { const id = ctx.params.id const nameOfConversation = await ctx.db.Conversation.findById(id) ctx.body = await new Promise((resolve, reject) => { firebaseIndex.fbController.getConversation(nameOfConversation.... Add solution