Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

db
images
Binary file added images/files-1705744214900.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/files-1705744297659.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/files-1705744297660.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/files-1705744336018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/files-1705744376630.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/files-1705744376631.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705728874083.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705728921573.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705729929671.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705729929672.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705729929674.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705740513741.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705740513743.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705740513744.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705740935449.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705740935451.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705740935463.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705744473794.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705747164586.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705747164587.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/images-1705747670114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,467 changes: 5,467 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"license": "MIT",
"dependencies": {
"bcryptjs": "^2.4.3",
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"jsonwebtoken": "^9.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/protected/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const getUser = async (req: Request, res: Response) => {

export const updateUser = async (req: Request, res: Response) => {
const user = req.user as { id: string };
const { email, name,skills,languages,title,about,website_url,location, } = req.body;
const { email, name,skills,languages,title,about, phone, website_url,location, } = req.body;



Expand All @@ -32,6 +32,7 @@ export const updateUser = async (req: Request, res: Response) => {
if (languages) updatedFields.languages = languages;
if (title) updatedFields.title = title;
if (about) updatedFields.about = about;
if (phone) updatedFields.phone = phone;
if (website_url) updatedFields.website_url = website_url;
if (location) updatedFields.location = location;

Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import express from 'express'
import dotenv from 'dotenv'

var cors = require('cors')
import path from 'path'
import authRoute from './routes/auth'
import protectedRoutes from './routes/protected'
import { connectDB } from './db/connect'
Expand All @@ -13,6 +14,8 @@ const port = process.env.PORT || 3000;

// middleware
app.use(express.json())
app.use(cors())
app.use('/images', express.static(path.join(path.dirname(__dirname), 'images')));

// Routes
app.use('/user', authRoute);
Expand Down
6 changes: 6 additions & 0 deletions src/models/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface IUser extends Document {
password: string;
title: string;
about: string;
phone: string;
website_url: string;
location: string;
skills: string[];
Expand Down Expand Up @@ -55,6 +56,11 @@ const UserSchema: Schema = new Schema({
max: 1200,
min: 100
},
phone: {
type: String,
max: 15,
min: 5
},
website_url: {
type: String,
max: 1024,
Expand Down