Fix company TIN field mapping in payload
This commit is contained in:
@@ -37,7 +37,11 @@ export const CompaniesPage = () => {
|
|||||||
const handleCreateCompany = async (e: React.FormEvent) => {
|
const handleCreateCompany = async (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
try {
|
try {
|
||||||
await apiClient.post('/companies', { name, tin, address });
|
await apiClient.post('/companies', {
|
||||||
|
name,
|
||||||
|
tax_identification_number: tin,
|
||||||
|
address
|
||||||
|
});
|
||||||
setIsAddModalOpen(false);
|
setIsAddModalOpen(false);
|
||||||
setName('');
|
setName('');
|
||||||
setTin('');
|
setTin('');
|
||||||
@@ -50,7 +54,7 @@ export const CompaniesPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const filteredCompanies = companies.filter(c =>
|
const filteredCompanies = companies.filter(c =>
|
||||||
c.name.includes(searchTerm) || c.tin?.includes(searchTerm)
|
c.name.includes(searchTerm) || c.tax_identification_number?.includes(searchTerm)
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -113,7 +117,7 @@ export const CompaniesPage = () => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<h3 className="text-xl font-bold text-slate-900 mb-1">{company.name}</h3>
|
<h3 className="text-xl font-bold text-slate-900 mb-1">{company.name}</h3>
|
||||||
<p className="text-sm text-slate-500 mb-6">الرقم الضريبي: <span className="font-mono font-bold text-slate-700">{company.tin || 'غير محدد'}</span></p>
|
<p className="text-sm text-slate-500 mb-6">الرقم الضريبي: <span className="font-mono font-bold text-slate-700">{company.tax_identification_number || 'غير محدد'}</span></p>
|
||||||
|
|
||||||
<div className="pt-4 border-t border-slate-100 flex items-center justify-between">
|
<div className="pt-4 border-t border-slate-100 flex items-center justify-between">
|
||||||
<div className="flex items-center gap-2 text-xs font-bold text-slate-500">
|
<div className="flex items-center gap-2 text-xs font-bold text-slate-500">
|
||||||
|
|||||||
Reference in New Issue
Block a user