adminforth 2.16.1-next.1 → 2.16.1-next.2

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.
@@ -194,7 +194,7 @@
194
194
  :row="row"
195
195
  :resource="resource"
196
196
  :adminUser="adminUser"
197
- @callAction="(payload? : Object) => startCustomAction(action.id, payload ?? row)"
197
+ @callAction="(payload? : Object) => startCustomAction(action.id, row, payload)"
198
198
  >
199
199
  <button
200
200
  type="button"
@@ -561,7 +561,8 @@ async function deleteRecord(row: any) {
561
561
 
562
562
  const actionLoadingStates = ref<Record<string | number, boolean>>({});
563
563
 
564
- async function startCustomAction(actionId: string, row: any) {
564
+ async function startCustomAction(actionId: string, row: any, extraData: Record<string, any> = {}) {
565
+ console.log('Starting custom action', actionId, row);
565
566
  actionLoadingStates.value[actionId] = true;
566
567
 
567
568
  const data = await callAdminForthApi({
@@ -571,7 +572,7 @@ async function startCustomAction(actionId: string, row: any) {
571
572
  resourceId: props.resource?.resourceId,
572
573
  actionId: actionId,
573
574
  recordId: row._primaryKeyValue,
574
- extra: row,
575
+ extra: extraData,
575
576
  }
576
577
  });
577
578
 
@@ -208,7 +208,7 @@
208
208
  :row="row"
209
209
  :resource="resource"
210
210
  :adminUser="adminUser"
211
- @callAction="(payload? : Object) => startCustomAction(action.id, payload ?? row)"
211
+ @callAction="(payload? : Object) => startCustomAction(action.id, row, payload )"
212
212
  >
213
213
  <button
214
214
  type="button"
@@ -586,7 +586,7 @@ async function deleteRecord(row: any) {
586
586
 
587
587
  const actionLoadingStates = ref<Record<string | number, boolean>>({});
588
588
 
589
- async function startCustomAction(actionId: string, row: any) {
589
+ async function startCustomAction(actionId: string, row: any, extraData: Record<string, any> = {}) {
590
590
  actionLoadingStates.value[actionId] = true;
591
591
 
592
592
  const data = await callAdminForthApi({
@@ -596,7 +596,7 @@ async function startCustomAction(actionId: string, row: any) {
596
596
  resourceId: props.resource?.resourceId,
597
597
  actionId: actionId,
598
598
  recordId: row._primaryKeyValue,
599
- extra: row
599
+ extra: extraData
600
600
  }
601
601
  });
602
602
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.16.1-next.1",
3
+ "version": "2.16.1-next.2",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",