adminforth 1.3.33 → 1.3.34

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.
@@ -373,10 +373,12 @@ export default class AdminForthRestAPI {
373
373
  }
374
374
  });
375
375
  item._label = resource.recordLabel(item);
376
- if (resource.options.listTableClickUrl) {
377
- item._clickUrl = resource.options.listTableClickUrl(item, adminUser);
378
- }
379
376
  });
377
+ if (resource.options.listTableClickUrl) {
378
+ yield Promise.all(data.data.map((item) => __awaiter(this, void 0, void 0, function* () {
379
+ item._clickUrl = yield resource.options.listTableClickUrl(item, adminUser);
380
+ })));
381
+ }
380
382
  // only after adminforth made all post processing, give user ability to edit it
381
383
  for (const hook of listify((_v = (_u = resource.hooks) === null || _u === void 0 ? void 0 : _u[source]) === null || _v === void 0 ? void 0 : _v.afterDatasourceResponse)) {
382
384
  const resp = yield hook({ resource, response: data.data, adminUser });
@@ -437,13 +437,15 @@ export default class AdminForthRestAPI {
437
437
  delete item[key];
438
438
  }
439
439
  })
440
-
441
440
  item._label = resource.recordLabel(item);
442
-
443
- if (resource.options.listTableClickUrl) {
444
- item._clickUrl = resource.options.listTableClickUrl(item, adminUser);
445
- }
446
441
  });
442
+ if (resource.options.listTableClickUrl) {
443
+ await Promise.all(
444
+ data.data.map(async (item) => {
445
+ item._clickUrl = await resource.options.listTableClickUrl(item, adminUser);
446
+ })
447
+ );
448
+ }
447
449
 
448
450
  // only after adminforth made all post processing, give user ability to edit it
449
451
  for (const hook of listify(resource.hooks?.[source]?.afterDatasourceResponse)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.3.33",
3
+ "version": "1.3.34",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1027,7 +1027,7 @@ export type AdminForthResource = {
1027
1027
  */
1028
1028
  listPageSize?: number,
1029
1029
 
1030
- listTableClickUrl?: (record: any, adminUser: AdminUser) => string,
1030
+ listTableClickUrl?: (record: any, adminUser: AdminUser) => Promise<string>,
1031
1031
 
1032
1032
  /**
1033
1033
  * Custom components which can be injected into AdminForth CRUD pages.