create role

This commit is contained in:
hamid zarghami
2025-02-18 17:16:18 +03:30
parent 71a11ff2e7
commit d0be217ea1
9 changed files with 150 additions and 69 deletions
+3 -2
View File
@@ -19,6 +19,7 @@ import { CustomerItemType } from '../customer/types/CustomerTypes'
import { useNavigate } from 'react-router-dom'
import { Pages } from '../../config/Pages'
import { ErrorType } from '../../helpers/types'
import moment from 'moment-jalaali'
const CreateDiscount: FC = () => {
@@ -57,8 +58,8 @@ const CreateDiscount: FC = () => {
values.userIds = [customerId]
const params: CreateDiscountType = {
...values,
startDate: new Date(values.startDate).toISOString(),
endDate: new Date(values.endDate).toISOString(),
startDate: moment(values.startDate, 'jYYYY-jMM-jDD').format('YYYY-MM-DD'),
endDate: moment(values.endDate, 'jYYYY-jMM-jDD').format('YYYY-MM-DD'),
amount: +values.amount
}
createDiscount.mutate(params, {
+1 -1
View File
@@ -85,7 +85,7 @@ const DiscountList: FC = () => {
return (
<tr key={item.id} className='tr'>
<Td text={String(index + 1)} />
<Td text={item.users[0].firstName + ' ' + item.users[0].lastName} />
<Td text={item.users[0] ? item.users[0].firstName + ' ' + item.users[0].lastName : ''} />
<Td text={t(`discount.${item.type}`)} />
<Td text={item.code} />
<Td text={moment(item.startDate, 'jYYYY-jMM-jDD').format('jYYYY-jMM-jDD')} />