From 8cbca862051dcc0039e6f0235dcfe08426742f55 Mon Sep 17 00:00:00 2001 From: Kfir Dayan Date: Tue, 20 Jun 2023 19:44:43 +0300 Subject: [PATCH] renaming model to schemas and created model folder --- .DS_Store | Bin 0 -> 8196 bytes src/controllers/CartController.ts | 6 +++--- src/controllers/ProductController.ts | 2 +- src/controllers/UserController.ts | 2 +- src/models/userModel.ts | 1 + src/schemas/{cartModel.ts => cartSchema.ts} | 0 src/schemas/{orderModel.ts => orderSchema.ts} | 0 .../{productModel.ts => productSchema.ts} | 0 src/schemas/{userModel.ts => userSchema.ts} | 0 src/services/sendGrid.ts | 4 ++-- 10 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 .DS_Store create mode 100644 src/models/userModel.ts rename src/schemas/{cartModel.ts => cartSchema.ts} (100%) rename src/schemas/{orderModel.ts => orderSchema.ts} (100%) rename src/schemas/{productModel.ts => productSchema.ts} (100%) rename src/schemas/{userModel.ts => userSchema.ts} (100%) diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e345b457ad0f2ddfd555d06b277c60d3d3a245f1 GIT binary patch literal 8196 zcmeHMy>AmS6n{=ad!elq1V~vbodjiSLq8}|)g^>7 zfQ7$+KLHj7#Kyos01^`e8v`=~Lj~{IPU5@dP`jW~Y{`B;zYqIHCK^GF%$gHv6|m3X}|Bxwc=0tNwtfI+|@U=TPe2;iAb#R@t1 zCD*hD0fWGQi2&sX8!OSYqFqTv>cB=^0g%RUSQP9hsDsp2G_7b?QsiJ^QWdFGW$KE- zq&kkO& zqx0%Kn=LxLh-23G{ki2Q(;u$*`Q<FD+f(+lyOg&s|(y&u=?*mp>CL2By*!Ov&ed`&@q?AKq-HtMhcc@9i&tdfdZX zVOHk@yhrhUc*n@}0LPtN({;F8#W7mvY1{`6CD?`vG+_>V9O}@(*29q$JcI&1JAqw# zjhgx{orJ7r0 zPsb&)_3DwpB}7)oW#fJE%>@}*p=;73?I7|xF42iiTnd~*uP%rPD`2Lrptn0JR#NZ) zJ)eW?_jr*5UurpUGGHN0kD^l7i^Dpsp|vbrN18&k%l?@}OzIj@Tu&290V#^W5mLt_ z-qbtmUIeiE4&PaEbf5V#_VlC5#(nM}a)!COKLC71qdlvEsFVvKd@%??-EJ<#gA!v2J3eLULV6 zg$gz#LgV5(jODo!y6ggP_`iB5d&*cX>&&~OdyJXJ){_S@7gx5V}n0qwO F|KHH+wiW;Y literal 0 HcmV?d00001 diff --git a/src/controllers/CartController.ts b/src/controllers/CartController.ts index 42d6a85..16f3135 100644 --- a/src/controllers/CartController.ts +++ b/src/controllers/CartController.ts @@ -1,7 +1,7 @@ import { Request, Response } from 'express'; -import { Cart, ICart } from '../schemas/cartModel'; -import { Product } from '../schemas/productModel'; -import { Order } from '../schemas/orderModel'; +import { Cart, ICart } from '../schemas/cartSchema'; +import { Product } from '../schemas/productSchema'; +import { Order } from '../schemas/orderSchema'; import { sendEmailasync } from '../services/sendGrid'; import { config } from 'dotenv'; diff --git a/src/controllers/ProductController.ts b/src/controllers/ProductController.ts index f08f515..abb7c2f 100644 --- a/src/controllers/ProductController.ts +++ b/src/controllers/ProductController.ts @@ -1,5 +1,5 @@ import { Request, Response } from 'express'; -import { Product } from '../schemas/productModel'; +import { Product } from '../schemas/productSchema'; import { handleCreateProductError } from '../middlewares/errorHandlers'; diff --git a/src/controllers/UserController.ts b/src/controllers/UserController.ts index 047b61f..fa36cef 100644 --- a/src/controllers/UserController.ts +++ b/src/controllers/UserController.ts @@ -1,7 +1,7 @@ import { Request, Response } from 'express'; import bcrypt from 'bcryptjs'; import jwt from 'jsonwebtoken'; -import { User, IUser } from '../schemas/userModel'; +import { User, IUser } from '../schemas/userSchema'; import { clearJwtCookie, setJwtCookie } from '../middlewares/checkAuth'; import validate from 'deep-email-validator'; diff --git a/src/models/userModel.ts b/src/models/userModel.ts new file mode 100644 index 0000000..1d0415c --- /dev/null +++ b/src/models/userModel.ts @@ -0,0 +1 @@ +import { User, IUser } from "../schemas/userSchema"; \ No newline at end of file diff --git a/src/schemas/cartModel.ts b/src/schemas/cartSchema.ts similarity index 100% rename from src/schemas/cartModel.ts rename to src/schemas/cartSchema.ts diff --git a/src/schemas/orderModel.ts b/src/schemas/orderSchema.ts similarity index 100% rename from src/schemas/orderModel.ts rename to src/schemas/orderSchema.ts diff --git a/src/schemas/productModel.ts b/src/schemas/productSchema.ts similarity index 100% rename from src/schemas/productModel.ts rename to src/schemas/productSchema.ts diff --git a/src/schemas/userModel.ts b/src/schemas/userSchema.ts similarity index 100% rename from src/schemas/userModel.ts rename to src/schemas/userSchema.ts diff --git a/src/services/sendGrid.ts b/src/services/sendGrid.ts index 8d48e49..182cee1 100644 --- a/src/services/sendGrid.ts +++ b/src/services/sendGrid.ts @@ -1,6 +1,6 @@ import { config } from "dotenv"; -import { Order } from "../schemas/orderModel"; -import { User } from "../schemas/userModel"; +import { Order } from "../schemas/orderSchema"; +import { User } from "../schemas/userSchema"; import client from '@sendgrid/mail'; config();