reading from openapi spec
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import * as React from "react";
|
||||
import { Box, Button, Avatar, CircularProgress, Typography } from "@mui/material";
|
||||
import { config } from "../../config";
|
||||
|
||||
interface ImageUploadFieldProps {
|
||||
label?: string;
|
||||
@@ -8,6 +6,7 @@ interface ImageUploadFieldProps {
|
||||
uploading?: boolean;
|
||||
onUpload: (file: File) => void;
|
||||
size?: number;
|
||||
baseUrl: string;
|
||||
}
|
||||
|
||||
export default function ImageUploadField({
|
||||
@@ -16,10 +15,11 @@ export default function ImageUploadField({
|
||||
uploading = false,
|
||||
onUpload,
|
||||
size = 64,
|
||||
baseUrl,
|
||||
}: ImageUploadFieldProps) {
|
||||
|
||||
const imgSrc = value
|
||||
? config.baseUrl.replace(/\/+$/, "") +
|
||||
? baseUrl.replace(/\/+$/, "") +
|
||||
"/" +
|
||||
value.replace(/^\/+/, "")
|
||||
: "";
|
||||
|
||||
Reference in New Issue
Block a user