This file contains hidden or 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
import {NextApiRequest, NextApiResponse} from 'next' | |
import jwt from 'jsonwebtoken' | |
type Handler = (req: NextApiRequest, res: NextApiResponse) => Promise<any> | |
const checkAuthMiddleware = (handler: Handler) => | |
async function (req: NextApiRequest, res: NextApiResponse): Promise<any> { | |
try { | |
// Check if the Authorization header exists and extract the token value | |
const authHeader = req.headers['authorization'] |
This file contains hidden or 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
import {COLLECTIONS} from '@/const' | |
import {NextApiRequest, NextApiResponse} from 'next' | |
import fs from 'fs/promises' | |
import formidable, {Fields, File, Files} from 'formidable' | |
import path from 'path' | |
import checkAuthMiddleware from '../../../backend/middleware/checkIsAdmin' | |
import {v4 as uuid} from 'uuid' | |
const IMAGE_DIRECTORY = './public/assets/images/' | |
const ACCEPTED_FILE_TYPES = ['jpg', 'png'] |
This file contains hidden or 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
import cloudinary from 'cloudinary'; | |
import fs from 'fs'; | |
import { CLOUDINARY_API_KEY, CLOUDINARY_API_SECRET, CLOUDINARY_CLOUD_NAME } from '@/config'; | |
cloudinary.v2.config({ | |
cloud_name: CLOUDINARY_CLOUD_NAME, | |
api_key: CLOUDINARY_API_KEY, | |
api_secret: CLOUDINARY_API_SECRET, | |
}); |
This file contains hidden or 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
const { errMessage } = require('../errController'); | |
const Event = require('./event.model'); | |
const Setting = require('./setting.model'); | |
const aggregateQueryOld = [ | |
{ | |
$match: { | |
$expr: { | |
$and: [ | |
{ $isArray: '$targetAudience' }, |
This file contains hidden or 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
import AppLogger from '@/services/AppLogger' | |
import type { UseTimeAgoMessages, UseTimeAgoUnitNamesDefault } from '@vueuse/core' | |
import { useI18n } from 'vue-i18n' | |
import { useTimeAgo } from '@vueuse/core' | |
const messages = { | |
en: { | |
common: { | |
timeAgo: { | |
'just-now': 'just now', |
This file contains hidden or 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
<template> | |
<v-container class="new-mone" v-if="formSchema"> | |
<v-row> | |
<v-col> | |
<h1> | |
{{ formName }} | |
</h1> | |
</v-col> | |
</v-row> | |
<v-row> |
This file contains hidden or 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
{ | |
"info": { | |
"_postman_id": "4ff3f646-3ee3-4227-b941-4a1467b9a478", | |
"name": "Monday_API", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", | |
"_exporter_id": "3883128" | |
}, | |
"item": [ | |
{ | |
"name": "Get Volunteer list", |
This file contains hidden or 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
import puppeteer from 'puppeteer'; | |
import sharp from 'sharp'; | |
import logger from '../../services/logger.js'; | |
import PDFDocument from 'pdfkit'; | |
import { promisify } from 'util'; | |
import fs from 'fs'; | |
import { Recipe } from 'muhammara'; | |
export async function convertToPdf(url, pdfOptions = {}) { | |
const browser = await puppeteer.launch(); |
This file contains hidden or 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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"command": "npm run start:dev", | |
"name": "Run Server", | |
"request": "launch", |