Skip to content

Commit e17425e

Browse files
committed
Crud Multiple Media Files Item
1 parent 3d0595f commit e17425e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+886
-141
lines changed

Diff for: .env.example

100644100755
File mode changed.

Diff for: .gitignore

100644100755
File mode changed.

Diff for: Dockerfile

100644100755
File mode changed.

Diff for: README.md

100644100755
File mode changed.

Diff for: api calls for postman/excel merch backend.postman_collection.json

100644100755
File mode changed.

Diff for: docker-compose.yml

100644100755
File mode changed.

Diff for: package-lock.json

100644100755
+56-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

100644100755
+6-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
"generate": "prisma generate --schema=./src/prisma/schema.prisma",
88
"migrate:dev": "prisma migrate dev --schema=./src/prisma/schema.prisma",
99
"dev": "npm run generate && nodemon src/index.ts",
10-
1110
"prebuild": "npm run generate",
1211
"build": "tsc",
13-
1412
"migrate:deploy": "prisma migrate deploy --schema=./src/prisma/schema.prisma",
1513
"prestart": "npm run generate && npm run migrate:deploy",
1614
"start": "node dist/index.js"
@@ -31,13 +29,18 @@
3129
"dependencies": {
3230
"@google-cloud/storage": "^7.7.0",
3331
"@prisma/client": "^5.7.1",
32+
"@types/lodash": "^4.14.202",
33+
"@types/uuid": "^9.0.7",
3434
"bcrypt": "^5.1.1",
3535
"cors": "^2.8.5",
3636
"dotenv": "^16.3.1",
3737
"express": "^4.18.2",
3838
"express-jwt": "^8.4.1",
39+
"express-validator": "^7.0.1",
3940
"jsonwebtoken": "^9.0.2",
41+
"lodash": "^4.17.21",
4042
"multer": "^1.4.5-lts.1",
41-
"nodemon": "^3.0.1"
43+
"nodemon": "^3.0.1",
44+
"uuid": "^9.0.1"
4245
}
4346
}

Diff for: src/controllers/AdminControllers.ts

100644100755
File mode changed.

Diff for: src/controllers/CartControllers.ts

100644100755
+7-3
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,16 @@ ${userProfile.address?.zipcode}
169169
`;
170170

171171
const stockUpdationCalls = userProfile.cartItems.map((cartItem) => {
172-
return prisma.item.update({
172+
return prisma.stockCount.update({
173173
where: {
174-
id: cartItem.itemId,
174+
itemId_colorOption_sizeOption: {
175+
itemId: cartItem.itemId,
176+
colorOption: cartItem.colorOption,
177+
sizeOption: cartItem.sizeOption,
178+
},
175179
},
176180
data: {
177-
stockCount: {
181+
count: {
178182
decrement: cartItem.quantity,
179183
},
180184
},

0 commit comments

Comments
 (0)