fix(types): strictly type prescriptions, orders and media, clear lint errors
Deploy Canina / deploy (push) Successful in 30s

This commit is contained in:
parsa aghaei committed 2026-08-18 16:00:46 +03:30
1 parent 6977f1d6e4
commit b494f95760
15 files changed
+3959 -3945

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
import { useState, useEffect, useRef, useCallback } from 'react';
import { Upload, Image as ImageIcon, Trash2, Copy, CheckCircle2, Search, X, FolderOpen, Video, FileText, Music, Play, Eye } from 'lucide-react';
import { Upload, Image as ImageIcon, Trash2, Copy, CheckCircle2, Search, X, FolderOpen, FileText, Music, Play } from 'lucide-react';
import { toast } from 'react-hot-toast';
import api, { BASE_DOMAIN } from '../services/api';
import Spinner from '../components/ui/Spinner';
@@ -342,7 +342,7 @@ export default function MediaManager() {
<button
key={tab.id}
type="button"
onClick={() => { setFilterType(tab.id as any); setPage(1); }}
onClick={() => { setFilterType(tab.id as 'all' | 'image' | 'video' | 'audio' | 'pdf'); setPage(1); }}
className={`px-3 py-1.5 rounded-xl text-xs font-bold transition-all cursor-pointer ${
filterType === tab.id
? 'bg-purple-600 text-white shadow-xs'
@@ -74,6 +74,7 @@ export interface Order {
firstName?: string;
lastName?: string;
mobile?: string;
phone?: string;
email?: string;
};
address?: {
@@ -1,5 +1,5 @@
import { useState, useEffect } from 'react';
import { FileText, Eye, CheckCircle2, XCircle, Clock, Filter, X, ExternalLink, Plus, Package, Phone, User, Dog, Cat } from 'lucide-react';
import { FileText, Eye, CheckCircle2, XCircle, Clock, Filter, X, Package, User, Dog, Cat } from 'lucide-react';
import { toast } from 'react-hot-toast';
import api, { BASE_DOMAIN } from '../services/api';
import Spinner from '../components/ui/Spinner';
@@ -189,7 +189,7 @@ export default function PrescriptionsManager() {
<td colSpan={6} className="py-12 text-center text-gray-500 font-medium">هیچ نسخه‌ای با این فیلتر یافت نشد</td>
</tr>
) : (
filteredPrescriptions.map((rx: any) => {
filteredPrescriptions.map((rx: Prescription) => {
const fullFile = getFileFullUrl(rx.fileUrl);
return (
<tr key={rx.id} className="hover:bg-gray-50/50 transition-colors">
@@ -285,13 +285,13 @@ export default function PrescriptionsManager() {
{/* Pet & User Details Card */}
<div className="p-4 bg-gray-50 rounded-2xl border border-gray-200 text-xs space-y-2">
<div className="flex items-center justify-between">
<span className="font-bold text-gray-700">سرپرست: {(selectedRx as any).user ? `${(selectedRx as any).user.firstName || ''} ${(selectedRx as any).user.lastName || ''}`.trim() || (selectedRx as any).user.mobile : 'کاربر مهمان'}</span>
<span className="font-mono text-gray-600">{(selectedRx as any).user?.mobile || '-'}</span>
<span className="font-bold text-gray-700">سرپرست: {selectedRx.user ? `${selectedRx.user.firstName || ''} ${selectedRx.user.lastName || ''}`.trim() || selectedRx.user.mobile : 'کاربر مهمان'}</span>
<span className="font-mono text-gray-600">{selectedRx.user?.mobile || '-'}</span>
</div>
{(selectedRx as any).pet && (
{selectedRx.pet && (
<div className="pt-2 border-t border-gray-200 flex items-center justify-between text-purple-900 font-bold">
<span>همدم: {(selectedRx as any).pet.name} ({(selectedRx as any).pet.type} - {(selectedRx as any).pet.breed})</span>
<span>وزن: {(selectedRx as any).pet.weight} kg | سن: {(selectedRx as any).pet.age} سال</span>
<span>همدم: {selectedRx.pet.name} ({selectedRx.pet.type} - {selectedRx.pet.breed})</span>
<span>وزن: {selectedRx.pet.weight} kg | سن: {selectedRx.pet.age} سال</span>
</div>
)}
{selectedRx.notes && (
+15
View File
@@ -131,6 +131,21 @@ export interface Prescription {
adminNotes?: string;
createdAt: string;
updatedAt: string;
user?: {
id?: string;
firstName?: string;
lastName?: string;
mobile?: string;
email?: string;
};
pet?: {
id?: string;
name?: string;
type?: string;
breed?: string;
weight?: number;
age?: number;
};
}
export interface B2BInquiry {