Skip to content

Commit

Permalink
build(root): ⚡ trigger rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
sahrohit committed Sep 5, 2023
1 parent c88cda8 commit 8e6f5a1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/api/src/entities/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { OrderDetail } from "./OrderDetail";
import { UserPayment } from "./UserPayment";
import { UserRole } from "./UserRole";
import { ProductReview } from "./ProductReview";
import { Account } from "./Account";

@ObjectType()
@Entity()
Expand Down Expand Up @@ -64,6 +65,9 @@ export class User extends BaseEntity {
@OneToMany(() => UserPayment, (userpayment) => userpayment.user)
userpayments!: UserPayment[];

@OneToMany(() => Account, (account) => account.user)
accounts!: Account[];

@OneToMany(() => Address, (address) => address.user)
addresses!: Address[];

Expand Down
13 changes: 13 additions & 0 deletions apps/api/src/resolvers/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ export class UserResolver {
return User.findOne({ where: { id: req.session?.userId } });
}

@Query(() => User, { nullable: true })
meWithAccount(@Ctx() { req }: MyContext) {
if (!req.session?.userId) {
return null;
}
return User.findOne({
where: { id: req.session?.userId },
relations: {
accounts: true,
},
});
}

@Mutation(() => UserResponse)
async register(
@Arg("options") options: RegisterInput,
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Box } from "@chakra-ui/react";
import Head from "next/head";
import { Product, useProductsQuery } from "@/generated/graphql";
import Footer from "@/components/shared/Footer";
import Navbar from "@/components/shared/navbar";
import ProductGrid from "@/components/pages/product/ProductGrid";
import ProductCard, {
ProductCardSkeleton,
} from "@/components/pages/product/ProductCard";
import { Product, useProductsQuery } from "@/generated/graphql";
import Result from "@/components/shared/Result";
import Banner from "@/components/shared/banner";
import { BRAND_NAME } from "../../constants";
Expand Down

2 comments on commit 8e6f5a1

@vercel
Copy link

@vercel vercel bot commented on 8e6f5a1 Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8e6f5a1 Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ecommerce-admin-client – ./apps/admin

ecommerce-admin-client.vercel.app
ecommerce-admin-client-git-main-sahrohit.vercel.app
ecommerce-admin-client-sahrohit.vercel.app

Please sign in to comment.