This file contains 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
git branch | grep -v "develop" | grep -v "f/testing" | grep -v "main" | xargs git branch -D |
This file contains 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 { Request as ExpressRequest, Response, NextFunction } from 'express' | |
import jwt, { JwtPayload } from 'jsonwebtoken' | |
import { USER_SCHEMA } from '@/models/user_model' | |
import { log } from 'console' | |
interface User { | |
name?: string | |
email: string | |
password: string | |
} |
This file contains 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 mongoose, { Document, Schema } from 'mongoose' | |
import bcrypt from 'bcrypt' | |
interface IUserSchema extends Document { | |
name?: string | |
email: string | |
password: string | |
match_password: (password: string) => Promise<boolean> | |
} |
This file contains 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 { Request, Response, NextFunction } from 'express' | |
import { z } from 'zod' | |
export function validate_schema(schema: z.AnyZodObject) { | |
return (req: Request, res: Response, next: NextFunction) => { | |
try { | |
schema.parse(req.body) | |
next() | |
} catch (error) { | |
if (error instanceof z.ZodError) { |
This file contains 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
.center { | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
transform: translate(-50%,-50%); | |
} |