Skip to content

Commit

Permalink
fix get repeats
Browse files Browse the repository at this point in the history
  • Loading branch information
Maaksaa committed Nov 15, 2024
1 parent 42fcc55 commit 64305fa
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { generateDownloadUrl, generateUploadUrl } from 'src/services/file-upload
import { useFieldController } from '../../hooks';

const { Dragger } = Upload;
// TODO: get from Questionnaire
const repeat = false;

type UploadFileProps = QuestionItemProps;

Expand Down Expand Up @@ -73,7 +71,7 @@ async function fetchDownloadUrl(filename: string) {
}

export function UploadFileControl({ parentPath, questionItem }: UploadFileProps) {
const { linkId, text, helpText } = questionItem;
const { linkId, text, helpText, repeats } = questionItem;
const fieldName = [...parentPath, linkId, 0, 'value'];
const { formItem } = useFieldController(fieldName, questionItem);

Expand Down Expand Up @@ -122,7 +120,7 @@ export function UploadFileControl({ parentPath, questionItem }: UploadFileProps)

return (
<Form.Item {...formItem} label={
(!hasUploadedFile || repeat) && (
(!hasUploadedFile || repeats) && (
<span>
{text}{' '}
{helpText && (
Expand All @@ -133,7 +131,7 @@ export function UploadFileControl({ parentPath, questionItem }: UploadFileProps)
</span>
)
}>
{!hasUploadedFile || repeat ? (
{!hasUploadedFile || repeats ? (
<Dragger {...props} listType="picture">

Check failure on line 135 in src/components/BaseQuestionnaireResponseForm/widgets/UploadFileControl/index.tsx

View workflow job for this annotation

GitHub Actions / Tests

Type '{ children: Element[]; listType: "picture"; name: string; multiple: boolean; fileList: UploadFile<any>[]; customRequest: (options: CustomRequestOptions) => Promise<...>; onChange(info: { ...; }): void; onRemove: () => void; }' is not assignable to type 'UploadProps<any>'.
<p className="ant-upload-drag-icon">
<InboxOutlined />
Expand Down

0 comments on commit 64305fa

Please sign in to comment.