Skip to content

Commit

Permalink
Merge pull request #28 from danial117/server_dev_10
Browse files Browse the repository at this point in the history
inital commit
  • Loading branch information
danial117 committed Aug 22, 2024
2 parents 971e724 + 6a04014 commit 5d58743
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions controllers/brand.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const GetAdminBrands = async (req, res) => {



export const AdminCreateBrand=async(req,res)=>{
export const AdminCreateBrand=async(req,res,next)=>{

try{

Expand Down Expand Up @@ -190,7 +190,7 @@ export const GetBrandProducts=async(req,res)=>{



export const AdminModifyBrand=async(req,res)=>{
export const AdminModifyBrand=async(req,res,next)=>{

try{

Expand Down
4 changes: 2 additions & 2 deletions controllers/news.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import NewsBlog from "../models/NewsModel.js";



export const AdminCreateNews=async(req,res)=>{
export const AdminCreateNews=async(req,res,next)=>{
try{

const data = req.body;
Expand Down Expand Up @@ -89,7 +89,7 @@ export const AdminGetNewsBlog=async(req,res)=>{



export const AdminModifyNews=async(req,res)=>{
export const AdminModifyNews=async(req,res,next)=>{

try{

Expand Down
3 changes: 2 additions & 1 deletion controllers/product.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export const AdminModifyProduct=async(req,res,next)=>{


}
throw new error

if (Array.isArray(data.category) && data.category.length>0) {

data['category'] = data.category.map((value) => {
Expand Down Expand Up @@ -322,6 +322,7 @@ export const AdminCreateProduct=async(req,res,next)=>{

const {outputMediumFileName,outputSmallFileName}= await compressAndSaveProductImage(file.filename)


// Find the product by ID

const product=new Product({
Expand Down

0 comments on commit 5d58743

Please sign in to comment.