Skip to content

Commit

Permalink
renamed product type
Browse files Browse the repository at this point in the history
  • Loading branch information
antonisdev committed Oct 10, 2024
1 parent c155898 commit 71da525
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/ListProductsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Table } from "antd";
import { useGetAllProductsQuery } from "../generated/graphql-types";
import DeleteProductButton from "./DeleteProductButton";
import EditProductRow from "./EditProduct/EditProductRow";
import { ArticleProps, ProductCardProps } from "../interface/types";
import { ArticleProps, Product } from "../interface/types";

function ListProductsTable() {
const { data: productsData } = useGetAllProductsQuery();
Expand Down Expand Up @@ -47,7 +47,7 @@ function ListProductsTable() {
title: "Actions",
key: "actions",
dataIndex: "id",
render: (id: string, record: ProductCardProps) => (
render: (id: string, record: Product) => (
<div className="flex gap-2">
<EditProductRow product={record} />
<DeleteProductButton productId={id} />
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/ProductCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Card, Button } from "antd";
import Meta from "antd/es/card/Meta";
import { ProductCardProps } from "../interface/types";
import { Product } from "../interface/types";

function ProductCard({ product }: { product: ProductCardProps }) {
function ProductCard({ product }: { product: Product }) {
return (
<Card
hoverable
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/interface/types.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface ProductCardProps {
export interface Product {
id: number;
name: string;
description: string;
Expand All @@ -9,11 +9,11 @@ export interface ProductCardProps {
export type EditProductModalProps = {
isModalOpen: boolean;
setIsModalOpen: (arg: boolean) => void;
product: ProductCardProps;
product: Product;
};

export type EditProductRowProps = {
product: ProductCardProps;
product: Product;
};

export type ArticleProps = {
Expand All @@ -22,7 +22,7 @@ export type ArticleProps = {
};

export interface EditProductFormProps {
product: ProductCardProps;
product: Product;
setIsModalOpen: (arg: boolean) => void;
}

Expand Down Expand Up @@ -53,7 +53,7 @@ export interface NewProductFormValues {
export type Article = {
id: number;
availability: boolean;
product?: ProductCardProps;
product?: Product;
};

export type Reservation = {
Expand Down

0 comments on commit 71da525

Please sign in to comment.