Удалено поле agentCommissionRate из компонентов AccountProfile и AccountProfileCompany, а также соответствующие элементы интерфейса. Обновлены запросы в компоненте SaleCategoriesTable для получения данных с нового API-эндпоинта.

This commit is contained in:
Redsandyg 2025-06-21 15:02:32 +03:00
parent 223c2d3bd6
commit 7924acd23f
3 changed files with 3 additions and 12 deletions

View File

@ -23,7 +23,6 @@ interface ProfileData {
registrationDate: string;
company: string;
commissionRate: number;
agentCommissionRate: number;
companyKey: string;
address?: string;
birthDate?: string;
@ -135,7 +134,6 @@ const AccountProfile: React.FC<AccountProfileProps> = ({ onNameChange }) => {
registrationDate: data.create_dttm || "",
company: data.company?.name || "",
commissionRate: data.company?.commission || 0,
agentCommissionRate: data.company?.agent_commission || 0,
companyKey: data.company?.key || "",
});
if (onNameChange) {
@ -178,7 +176,6 @@ const AccountProfile: React.FC<AccountProfileProps> = ({ onNameChange }) => {
company={profileData.company}
companyKey={profileData.companyKey}
commissionRate={profileData.commissionRate}
agentCommissionRate={profileData.agentCommissionRate}
onCopy={handleCopy}
/>
{isEditing && (

View File

@ -6,7 +6,6 @@ interface AccountProfileCompanyProps {
company: string;
companyKey: string;
commissionRate: number;
agentCommissionRate: number;
onCopy: () => void;
}
@ -14,7 +13,6 @@ const AccountProfileCompany: React.FC<AccountProfileCompanyProps> = ({
company,
companyKey,
commissionRate,
agentCommissionRate,
onCopy
}) => (
<div className={styles.card}>
@ -37,10 +35,6 @@ const AccountProfileCompany: React.FC<AccountProfileCompanyProps> = ({
<label className={styles.label}>Процент комиссии компании</label>
<div className={styles.commissionValue}>{commissionRate}%</div>
</div>
<div>
<label className={styles.label}>Процент комиссии агента</label>
<div className={styles.commissionValue}>{agentCommissionRate}%</div>
</div>
</div>
</div>
);

View File

@ -28,7 +28,7 @@ const SaleCategoriesTable: React.FC = () => {
try {
const token = Cookies.get("access_token");
if (!token) return;
const res = await fetch("/api/account/category", {
const res = await fetch("/api/category", {
method: "GET",
headers: {
"Content-Type": "application/json",
@ -52,7 +52,7 @@ const SaleCategoriesTable: React.FC = () => {
const token = Cookies.get("access_token");
if (!token) return;
try {
const res = await fetch("/api/account/category", {
const res = await fetch("/api/category", {
method: "POST",
headers: {
"Content-Type": "application/json",
@ -84,7 +84,7 @@ const SaleCategoriesTable: React.FC = () => {
const token = Cookies.get("access_token");
if (!token) return;
try {
const res = await fetch("/api/account/category", {
const res = await fetch("/api/category", {
method: "POST",
headers: {
"Content-Type": "application/json",