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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Note: Certain mutations and queries may require the user to be authenticated and

```graphql
mutation {
register(input: {
register(registerInput: {
name: "John Doe",
email: "johndoe@example.com",
password: "password123"
password: "pass123"
}) {
id
name
Expand All @@ -113,9 +113,9 @@ mutation {

```graphql
mutation {
login(input: {
login(loginnput: {
email: "johndoe@example.com",
password: "password123"
password: "pass123"
}) {
accessToken
message
Expand Down
2 changes: 1 addition & 1 deletion src/components/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class AuthService {
}

private createJwt(payload: string | Buffer | Record<any, any>) {
return this.jwtService.sign(payload);
return this.jwtService.sign({ id: payload });
}

public async register({ email, name, password }: RegisterInput) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/product/product.repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class ProductRepo {
.limit(limit)
.skip((page - 1) * limit);

const productsCount = await this.productModel.find().count();
const productsCount = await this.productModel.countDocuments();

return {
products,
Expand Down