fix(lint): resolve typescript and eslint warnings in products, reviews, videos and update graphify
Deploy Canina / deploy (push) Failing after 44s
Deploy Canina / deploy (push) Failing after 44s
This commit is contained in:
1 parent
f0f50c75cc
commit
95d79518e7
17 files changed
+51855
-49727
No files matched your search
@@ -398,10 +398,11 @@ export default function Products() {
|
||||
setIsModalOpen(false);
|
||||
setImageErrors({});
|
||||
await fetchData();
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
console.error('Save failed', error);
|
||||
const serverMsg = error.response?.data?.message || error.message;
|
||||
if (serverMsg && !error._toastShown) {
|
||||
const axiosErr = error as { response?: { data?: { message?: string } }; message?: string; _toastShown?: boolean };
|
||||
const serverMsg = axiosErr.response?.data?.message || axiosErr.message;
|
||||
if (serverMsg && !axiosErr._toastShown) {
|
||||
toast.error(`خطا در ذخیره محصول: ${serverMsg}`);
|
||||
}
|
||||
}
|
||||
@@ -1297,12 +1298,16 @@ export default function Products() {
|
||||
/>
|
||||
{formData.imageUrl && (
|
||||
<div className="relative group w-16 h-16 shrink-0 rounded-xl border border-gray-200 overflow-hidden bg-gray-50 flex items-center justify-center">
|
||||
<img
|
||||
src={getProductImageUrl(formData.imageUrl)}
|
||||
alt="Cover"
|
||||
className="w-full h-full object-contain"
|
||||
onError={() => setMediaImageError(true)}
|
||||
/>
|
||||
{mediaImageError ? (
|
||||
<ImageIcon className="w-6 h-6 text-gray-300" />
|
||||
) : (
|
||||
<img
|
||||
src={getProductImageUrl(formData.imageUrl)}
|
||||
alt="Cover"
|
||||
className="w-full h-full object-contain"
|
||||
onError={() => setMediaImageError(true)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -1321,7 +1326,7 @@ export default function Products() {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setMediaTargetField('gallery' as any);
|
||||
setMediaTargetField('gallery');
|
||||
setIsMediaSelectorOpen(true);
|
||||
}}
|
||||
className="bg-blue-600 hover:bg-blue-700 text-white px-4 py-1.5 rounded-xl text-xs font-bold transition-all cursor-pointer flex items-center gap-1.5"
|
||||
|
||||
Reference in new issue
Block a user