This commit is contained in:
@@ -56,7 +56,7 @@ const CreateProduct: FC = () => {
|
||||
onSuccess: (data) => {
|
||||
const imagesUrl: string[] = []
|
||||
data.data?.map((item) => {
|
||||
imagesUrl.push(item.url)
|
||||
imagesUrl.push(item.key)
|
||||
})
|
||||
values.images = imagesUrl
|
||||
handleSave(values)
|
||||
|
||||
@@ -59,7 +59,7 @@ const UpdateProduct: FC = () => {
|
||||
onSuccess: (data) => {
|
||||
const imagesUrl: string[] = [...values.images]
|
||||
data.data?.map((item) => {
|
||||
imagesUrl.push(item.url)
|
||||
imagesUrl.push(item.key)
|
||||
})
|
||||
values.images = imagesUrl
|
||||
handleSave(values)
|
||||
|
||||
@@ -58,7 +58,7 @@ const ProductCategory: FC = () => {
|
||||
if (file) {
|
||||
upload(file, {
|
||||
onSuccess: (data) => {
|
||||
values.avatarUrl = data?.data?.url
|
||||
values.avatarUrl = data?.data?.key
|
||||
handleSave(values)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { type FC, useMemo } from 'react'
|
||||
import PresignedImage from '@/components/PresignedImage'
|
||||
import { useDeleteCategory, useGetCategory } from '../hooks/useProductData'
|
||||
import Table from '@/components/Table'
|
||||
import type { ColumnType, RowDataType } from '@/components/types/TableTypes'
|
||||
@@ -33,7 +34,7 @@ const CategoryList: FC = () => {
|
||||
{
|
||||
title: 'تصویر',
|
||||
key: 'avatarUrl',
|
||||
render: (item) => item.avatarUrl ? <img src={item.avatarUrl} className='w-14' alt={item.title} /> : '-'
|
||||
render: (item) => item.avatarUrl ? <PresignedImage src={item.avatarUrl} className='w-14' alt={item.title} /> : '-'
|
||||
},
|
||||
{
|
||||
title: 'عنوان',
|
||||
|
||||
@@ -60,7 +60,7 @@ const UpdateCategory: FC = () => {
|
||||
if (file) {
|
||||
upload(file, {
|
||||
onSuccess: (data) => {
|
||||
values.avatarUrl = data?.data?.url
|
||||
values.avatarUrl = data?.data?.key
|
||||
handleSave(values)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user