fix: update error code icon handling to use URL if available
This commit is contained in:
@@ -159,7 +159,7 @@ const EditBrandDevice = () => {
|
|||||||
sparepart: ec.sparepart || [],
|
sparepart: ec.sparepart || [],
|
||||||
errorCodeIcon: ec.path_icon
|
errorCodeIcon: ec.path_icon
|
||||||
? {
|
? {
|
||||||
name: 'icon',
|
name: ec.path_icon.split('/').pop(), // Ambil nama file dari path
|
||||||
uploadPath: ec.path_icon,
|
uploadPath: ec.path_icon,
|
||||||
url: (() => {
|
url: (() => {
|
||||||
const pathParts = ec.path_icon.split('/');
|
const pathParts = ec.path_icon.split('/');
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ const ErrorCodeSimpleForm = ({
|
|||||||
<div style={{ marginTop: 8 }}>
|
<div style={{ marginTop: 8 }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||||
<img
|
<img
|
||||||
src={errorCodeIcon.uploadPath}
|
src={errorCodeIcon.url || errorCodeIcon.uploadPath}
|
||||||
alt="Error Code Icon"
|
alt="Error Code Icon"
|
||||||
style={{
|
style={{
|
||||||
width: 50,
|
width: 50,
|
||||||
|
|||||||
Reference in New Issue
Block a user