I hereby claim:
- I am codiini on github.
- I am iniubong (https://keybase.io/iniubong) on keybase.
- I have a public key ASCGYqXjzjhk45J-NekWqfX8pvH3vxLPDTKQJKT83gOK-go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
//first require all dependencies | |
require("dotenv").config() | |
const cloudinary = require("cloudinary").v2 | |
let streamifier = require("streamifier") | |
//Here we'll configure the cloudinary API | |
cloudinary.config({ | |
cloud_name: process.env.CLOUDINARY_CLOUD_NAME, | |
api_key: process.env.CLOUDINARY_API_KEY, | |
api_secret: process.env.CLOUDINARY_API_SECRET, | |
}) |
import React, { useState } from "react" | |
import * as styles from "../components/index.module.css" | |
const IndexPage = () => { | |
const [file, setFile] = useState() | |
const [uploadedImg, setUploadedImg] = useState() | |
const [moderatedImage, setModeratedImage] = useState() | |
const [isLoading, setIsLoading] = useState(false) | |
const [isError, setIsError] = useState(false) |
.wrapper { | |
padding-top: 50px; | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
justify-content: center; | |
} | |
.title { | |
font-size: 2em; |
import { collection } from "../utils/mongodb" | |
export default async function handler(req, res) { | |
try { | |
//Accept asset Id to search db for image with a status type of moderation | |
const moderatedImage = await collection.findOne({ | |
asset_id: req.body.asset_id, | |
notification_type: "moderation", | |
}) | |
//if the image is found, return the image |