@openinc/parse-server-opendash 3.32.0 → 3.32.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.
|
@@ -26,5 +26,5 @@ async function getTicketLink(ticket, user) {
|
|
|
26
26
|
catch (error) {
|
|
27
27
|
console.warn("[@openinc/parse-server-opendash] Could not get a hostname, defaulting to localhost");
|
|
28
28
|
}
|
|
29
|
-
return `${hostname}/openservice/
|
|
29
|
+
return `${hostname}/openservice/tickets/detail/${ticket.id}`;
|
|
30
30
|
}
|
package/dist/hooks/Assets.js
CHANGED
|
@@ -8,17 +8,20 @@ async function init() {
|
|
|
8
8
|
const { object, original, user } = request;
|
|
9
9
|
await (0, schema_1.defaultHandler)(request);
|
|
10
10
|
await (0, schema_1.defaultAclHandler)(request);
|
|
11
|
-
// TODO
|
|
12
11
|
});
|
|
13
12
|
(0, schema_1.afterSaveHook)(types_1.Assets, async (request) => {
|
|
14
13
|
const { object, original, user } = request;
|
|
15
|
-
// TODO
|
|
16
14
|
});
|
|
17
15
|
(0, schema_1.beforeDeleteHook)(types_1.Assets, async (request) => {
|
|
18
16
|
const { object } = request;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
try {
|
|
18
|
+
const objWithFile = await object.fetchWithInclude("file", {
|
|
19
|
+
useMasterKey: true,
|
|
20
|
+
});
|
|
21
|
+
await objWithFile?.get("file")?.destroy({ useMasterKey: true });
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error("[@openinc/parse-server-opendash] Error deleting associated file. Asset will be deleted but the file may remain orphaned.", error);
|
|
25
|
+
}
|
|
23
26
|
});
|
|
24
27
|
}
|