@applica-software-guru/react-admin 1.5.258 → 1.5.259

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -115,5 +115,5 @@
115
115
  "type": "module",
116
116
  "types": "dist/index.d.ts",
117
117
  "typings": "dist/index.d.ts",
118
- "version": "1.5.258"
118
+ "version": "1.5.259"
119
119
  }
@@ -26,7 +26,7 @@ function AttachmentField({
26
26
  const entity = _resource || resource.replace('entities/', '');
27
27
  const entityId = _entityId || record?.id;
28
28
  const attachment = await dataProvider.getFile(
29
- `/attachments/${entity}/${entityId || record?.id}/${property || props?.source}/${item?.id || record?.id}`
29
+ `/attachments/${entity}/${entityId}/${property || props?.source}/${item?.id || record?.id}`
30
30
  );
31
31
  const link = document.createElement('a');
32
32
  link.href = attachment;
@@ -92,8 +92,8 @@ type AttachmentFieldProps = BaseAttachmentFieldProps & {
92
92
  */
93
93
  showUser?: boolean;
94
94
  /**
95
- * When the AttachmentInput is used inside a nested form, you can specify the root entity to use for the REST calls.
96
- * If not specified, the default value is the current entity passed by context.
95
+ * When the AttachmentInput is used inside a nested form, you can specify the root resource to use for the REST calls.
96
+ * If not specified, the default value is the current resource passed by context.
97
97
  */
98
98
  resource?: string;
99
99
  };
@@ -68,7 +68,7 @@ function AttachmentInput({
68
68
  {/** @ts-ignore */}
69
69
  <StyledFileInput type={type} multiple={multiple} disabled={disabled}>
70
70
  {/* @ts-ignore */}
71
- {React.cloneElement(children, { ...children.props, entityId, property })}
71
+ {React.cloneElement(children, { entityId, property, ...children.props })}
72
72
  </StyledFileInput>
73
73
  </LabeledInput>
74
74
  );