@budibase/frontend-core 3.20.11 → 3.20.13

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "3.20.11",
3
+ "version": "3.20.13",
4
4
  "description": "Budibase frontend core libraries used in builder and client",
5
5
  "author": "Budibase",
6
6
  "license": "MPL-2.0",
@@ -17,5 +17,5 @@
17
17
  "shortid": "2.2.15",
18
18
  "socket.io-client": "^4.7.5"
19
19
  },
20
- "gitHead": "80707b68f76ee020f52c3242e6d987bdfd1a19ff"
20
+ "gitHead": "104666064bccf2667772e62ec951ad390de5000e"
21
21
  }
@@ -11,7 +11,7 @@
11
11
  export let readonly = false
12
12
  export let api
13
13
 
14
- const { API, notifications, props } = getContext("grid")
14
+ const { API, notifications, props, datasource } = getContext("grid")
15
15
 
16
16
  let isOpen = false
17
17
  let modal
@@ -47,9 +47,12 @@
47
47
  attachRequest.append("file", signatureFile)
48
48
 
49
49
  try {
50
- const uploadReq = await API.uploadBuilderAttachment(attachRequest)
51
- const [signatureAttachment] = uploadReq
52
- onChange(signatureAttachment)
50
+ const tableId = $datasource?.tableId || $datasource?.id
51
+ const result = await (tableId
52
+ ? API.uploadAttachment(tableId, attachRequest)
53
+ : API.uploadBuilderAttachment(attachRequest))
54
+
55
+ onChange(result[0])
53
56
  } catch (error) {
54
57
  $notifications.error(error.message || "Failed to save signature")
55
58
  return []