Skip to content

Commit

Permalink
feat(backend): ✨ Modify quantity of product
Browse files Browse the repository at this point in the history
  • Loading branch information
kjarret committed Jul 18, 2024
1 parent 2fbadc4 commit ac87c67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { ApolloServer } from "@apollo/server";
import { startStandaloneServer } from "@apollo/server/standalone";
import * as jwt from "jsonwebtoken";
import { createClient } from "redis";
import "reflect-metadata";
import { buildSchema } from "type-graphql";
// import { authChecker } from "./authChecker";
import * as jwt from "jsonwebtoken";
import dataSource from "./config/datasource";
import { fillDatabaseIfEmpty } from "./fillDatabaseIfEmpty";
import {
Expand Down
7 changes: 7 additions & 0 deletions backend/src/resolvers/checkout.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ export default class CheckoutResolver {
},
unit_amount: product.price * 100,
},
adjustable_quantity: {
enabled: true,
minimum: 1,
maximum: 6,
},
quantity: product.quantity,
})),
mode: "payment",
success_url: "http://localhost:3000/stripe/success",
/* success_url:
"http://localhost:3000/stripe/success?session_id={CHECKOUT_SESSION_ID}", */
cancel_url: "http://localhost:3000/cart",
});
return session.url;
Expand Down

0 comments on commit ac87c67

Please sign in to comment.