id number to string

This commit is contained in:
hamid zarghami
2026-02-16 11:34:43 +03:30
parent 8cc5dae04e
commit 384acee317
9 changed files with 23 additions and 23 deletions
+2 -2
View File
@@ -339,8 +339,8 @@ const MyComponent = () => {
];
const data = [
{ id: 1, name: 'علی', email: 'ali@example.com' },
{ id: 2, name: 'فاطمه', email: 'fateme@example.com' },
{ id: '1', name: 'علی', email: 'ali@example.com' },
{ id: '2', name: 'فاطمه', email: 'fateme@example.com' },
];
const handlePageChange = (page: number) => {
+2 -2
View File
@@ -1,5 +1,5 @@
export interface RowDataType {
id: string | number;
id: string;
[key: string]: unknown;
}
@@ -30,7 +30,7 @@ export interface TableProps<T extends RowDataType> {
columns: ColumnType<T>[];
data?: T[];
isLoading?: boolean;
onRowClick?: (id: string | number, item: T) => void;
onRowClick?: (id: string, item: T) => void;
className?: string;
rowClassName?: string | ((item: T, index: number) => string);
noDataMessage?: string;
+3 -3
View File
@@ -2,7 +2,7 @@ import { type Order } from '../types/OrderTypes';
export const ordersData: Order[] = [
{
id: 1,
id: '1',
number: '123455',
title: 'کارت ویزیت',
creationDate: {
@@ -13,7 +13,7 @@ export const ordersData: Order[] = [
unreadMessages: 2
},
{
id: 2,
id: '2',
number: '123455',
title: 'شاپینگ بگ',
creationDate: {
@@ -24,7 +24,7 @@ export const ordersData: Order[] = [
unreadMessages: 0
},
{
id: 3,
id: '3',
number: '123455',
title: 'کارت ویزیت',
creationDate: {
@@ -1,7 +1,7 @@
import { type RowDataType } from '@/components/types/TableTypes';
export interface Order extends RowDataType {
id: string | number;
id: string;
number: string;
title: string;
creationDate: {
+3 -3
View File
@@ -6,7 +6,7 @@ import Table from '@/components/Table'
import type { RowDataType } from '@/components/types/TableTypes'
interface InvoiceItem extends RowDataType {
id: number
id: string
image: string | null
title: string
quantity: string
@@ -30,7 +30,7 @@ const InvoiceDetail: FC = () => {
const items: InvoiceItem[] = [
{
id: 1,
id: '1',
image: null,
title: 'شاپینگ بک : پوشش UV برای و پوشش سلفون مات و UV برای و پرجسته',
quantity: '۲۰۰۰',
@@ -40,7 +40,7 @@ const InvoiceDetail: FC = () => {
confirmed: true
},
{
id: 2,
id: '2',
image: null,
title: 'شاپینگ بک : پوشش UV برای و پوشش سلفون مات و UV برای و پرجسته',
quantity: '۱۰۰۰',
+2 -2
View File
@@ -77,7 +77,7 @@ const ProformaInvoice: FC = () => {
]}
data={[
{
id: 1,
id: '1',
service: 'خدمت 1',
issueDate: '2021-01-01',
lastConfirmDate: '2021-01-01',
@@ -86,7 +86,7 @@ const ProformaInvoice: FC = () => {
paymentStatus: 'پرداخت شده',
},
{
id: 2,
id: '2',
service: 'خدمت 2',
issueDate: '2021-01-01',
lastConfirmDate: '2021-01-01',
@@ -19,7 +19,7 @@ const ManageAttribute: FC<Props> = (props) => {
const { attributes, formik } = props
const handleChange = (attributeId: number, value: string) => {
const handleChange = (attributeId: string, value: string) => {
const attribute = formik.values.attributes
const index: number = attribute.findIndex(o => o.attributeId === attributeId)
if (index > -1) {
+1 -1
View File
@@ -42,7 +42,7 @@ const Order: FC<Props> = ({ addNewItem }) => {
attributes: []
},
validationSchema: Yup.object({
productId: Yup.number().required('این فیلد اجباری می باشد'),
productId: Yup.string().required('این فیلد اجباری می باشد'),
quantity: Yup.number().required('این فیلد اجباری می باشد'),
}),
onSubmit: async (values) => {
+8 -8
View File
@@ -5,7 +5,7 @@ import type { RowDataType } from "@/components/types/TableTypes";
export type CategoryType = {
avatarUrl?: string;
createdAt: string;
id: number;
id: string;
isActive: boolean;
order: number;
parent?: CategoryType;
@@ -18,10 +18,10 @@ export type AttachmentsType = {
};
export type OrderType = {
productId?: number;
productId?: string;
quantity?: number;
attributes: {
attributeId: number;
attributeId: string;
value: string | number;
}[];
attachments: AttachmentsType[];
@@ -29,20 +29,20 @@ export type OrderType = {
};
export type AttributeValueType = {
attribute: number;
attribute: string;
createdAt: string;
id: number;
id: string;
order: number;
value: string;
};
export type AttributeType = {
createdAt: string;
id: number;
id: string;
isRequired: boolean;
name: string;
order: number;
product: number;
product: string;
type: FieldTypeEnum;
options: AttributeValueType[];
};
@@ -115,7 +115,7 @@ export type TicketType = {
attachments: AttachmentsType[];
content: string;
createdAt: string;
id: number;
id: string;
user?: string;
};