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