@driveflux/admin-utils 4.0.64 → 4.0.65
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/dist/resource.js +7 -7
- package/package.json +2 -2
package/dist/resource.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { config } from '@driveflux/config/frontend';
|
|
2
|
-
|
|
2
|
+
var RESOURCE_LINKS_MAP = {
|
|
3
3
|
Subscription: '/subscriptions',
|
|
4
4
|
Vehicle: '/vehicles',
|
|
5
5
|
SubscriptionReservation: '/reservations',
|
|
@@ -13,13 +13,13 @@ const RESOURCE_LINKS_MAP = {
|
|
|
13
13
|
Payout: '/payouts',
|
|
14
14
|
Log: '/activity-logs',
|
|
15
15
|
OffPlatformTransaction: '/transactions',
|
|
16
|
-
SubscriptionContract: '/contracts'
|
|
16
|
+
SubscriptionContract: '/contracts'
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export var isLinkableToAdmin = function(model) {
|
|
19
19
|
return model in RESOURCE_LINKS_MAP;
|
|
20
20
|
};
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
export var adminResourceLink = function(model, id, options) {
|
|
22
|
+
var _options_baseUrl;
|
|
23
|
+
var baseUrl = (_options_baseUrl = options === null || options === void 0 ? void 0 : options.baseUrl) !== null && _options_baseUrl !== void 0 ? _options_baseUrl : "".concat(config.appUrl, "/admin");
|
|
24
|
+
return "".concat(baseUrl).concat(RESOURCE_LINKS_MAP[model], "/").concat(id);
|
|
24
25
|
};
|
|
25
|
-
//# sourceMappingURL=resource.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/admin-utils",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.65",
|
|
4
4
|
"description": "Utilites for admin meant to be shared with other packages. Do not import this module in the user facing site. It's strictly for admin and api or backend services",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@driveflux/config": "3.0.9",
|
|
17
|
-
"@driveflux/db": "4.
|
|
17
|
+
"@driveflux/db": "4.1.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@driveflux/fab": "4.0.0",
|