Удалено поле agentCommissionRate из компонентов AccountProfile и AccountProfileCompany, а также соответствующие элементы интерфейса. Обновлены запросы в компоненте SaleCategoriesTable для получения данных с нового API-эндпоинта.
This commit is contained in:
parent
223c2d3bd6
commit
7924acd23f
@ -23,7 +23,6 @@ interface ProfileData {
|
|||||||
registrationDate: string;
|
registrationDate: string;
|
||||||
company: string;
|
company: string;
|
||||||
commissionRate: number;
|
commissionRate: number;
|
||||||
agentCommissionRate: number;
|
|
||||||
companyKey: string;
|
companyKey: string;
|
||||||
address?: string;
|
address?: string;
|
||||||
birthDate?: string;
|
birthDate?: string;
|
||||||
@ -135,7 +134,6 @@ const AccountProfile: React.FC<AccountProfileProps> = ({ onNameChange }) => {
|
|||||||
registrationDate: data.create_dttm || "",
|
registrationDate: data.create_dttm || "",
|
||||||
company: data.company?.name || "",
|
company: data.company?.name || "",
|
||||||
commissionRate: data.company?.commission || 0,
|
commissionRate: data.company?.commission || 0,
|
||||||
agentCommissionRate: data.company?.agent_commission || 0,
|
|
||||||
companyKey: data.company?.key || "",
|
companyKey: data.company?.key || "",
|
||||||
});
|
});
|
||||||
if (onNameChange) {
|
if (onNameChange) {
|
||||||
@ -178,7 +176,6 @@ const AccountProfile: React.FC<AccountProfileProps> = ({ onNameChange }) => {
|
|||||||
company={profileData.company}
|
company={profileData.company}
|
||||||
companyKey={profileData.companyKey}
|
companyKey={profileData.companyKey}
|
||||||
commissionRate={profileData.commissionRate}
|
commissionRate={profileData.commissionRate}
|
||||||
agentCommissionRate={profileData.agentCommissionRate}
|
|
||||||
onCopy={handleCopy}
|
onCopy={handleCopy}
|
||||||
/>
|
/>
|
||||||
{isEditing && (
|
{isEditing && (
|
||||||
|
|||||||
@ -6,7 +6,6 @@ interface AccountProfileCompanyProps {
|
|||||||
company: string;
|
company: string;
|
||||||
companyKey: string;
|
companyKey: string;
|
||||||
commissionRate: number;
|
commissionRate: number;
|
||||||
agentCommissionRate: number;
|
|
||||||
onCopy: () => void;
|
onCopy: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,7 +13,6 @@ const AccountProfileCompany: React.FC<AccountProfileCompanyProps> = ({
|
|||||||
company,
|
company,
|
||||||
companyKey,
|
companyKey,
|
||||||
commissionRate,
|
commissionRate,
|
||||||
agentCommissionRate,
|
|
||||||
onCopy
|
onCopy
|
||||||
}) => (
|
}) => (
|
||||||
<div className={styles.card}>
|
<div className={styles.card}>
|
||||||
@ -37,10 +35,6 @@ const AccountProfileCompany: React.FC<AccountProfileCompanyProps> = ({
|
|||||||
<label className={styles.label}>Процент комиссии компании</label>
|
<label className={styles.label}>Процент комиссии компании</label>
|
||||||
<div className={styles.commissionValue}>{commissionRate}%</div>
|
<div className={styles.commissionValue}>{commissionRate}%</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label className={styles.label}>Процент комиссии агента</label>
|
|
||||||
<div className={styles.commissionValue}>{agentCommissionRate}%</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -28,7 +28,7 @@ const SaleCategoriesTable: React.FC = () => {
|
|||||||
try {
|
try {
|
||||||
const token = Cookies.get("access_token");
|
const token = Cookies.get("access_token");
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
const res = await fetch("/api/account/category", {
|
const res = await fetch("/api/category", {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
@ -52,7 +52,7 @@ const SaleCategoriesTable: React.FC = () => {
|
|||||||
const token = Cookies.get("access_token");
|
const token = Cookies.get("access_token");
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
try {
|
try {
|
||||||
const res = await fetch("/api/account/category", {
|
const res = await fetch("/api/category", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
@ -84,7 +84,7 @@ const SaleCategoriesTable: React.FC = () => {
|
|||||||
const token = Cookies.get("access_token");
|
const token = Cookies.get("access_token");
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
try {
|
try {
|
||||||
const res = await fetch("/api/account/category", {
|
const res = await fetch("/api/category", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user