@burdenoff/microfe-eventfullymanaged 2026.827.1 → 2026.828.1
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/eventfullymanaged/hooks/index.d.ts +1 -0
- package/dist/eventfullymanaged/hooks/index.d.ts.map +1 -1
- package/dist/eventfullymanaged/hooks/index.js +3 -0
- package/dist/eventfullymanaged/hooks/useEventDelete.d.ts +19 -0
- package/dist/eventfullymanaged/hooks/useEventDelete.d.ts.map +1 -0
- package/dist/eventfullymanaged/hooks/useEventDelete.js +16 -0
- package/dist/eventfullymanaged/hooks/useEventDelete.js.map +1 -0
- package/dist/eventfullymanaged/pages/events/EventDetailPage.d.ts.map +1 -1
- package/dist/eventfullymanaged/pages/events/EventDetailPage.js +263 -250
- package/dist/eventfullymanaged/pages/events/EventDetailPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/EventsPage.d.ts.map +1 -1
- package/dist/eventfullymanaged/pages/modules/EventsPage.js +231 -229
- package/dist/eventfullymanaged/pages/modules/EventsPage.js.map +1 -1
- package/dist/eventfullymanaged/store/eventfullyManagedStore.js +15 -0
- package/dist/eventfullymanaged/store/eventfullyManagedStore.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eventfullymanaged/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eventfullymanaged/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UseEventDeleteOptions {
|
|
2
|
+
/** Name shown in the success toast (e.g. "Event deleted Annual Meetup"). */
|
|
3
|
+
name?: string;
|
|
4
|
+
/** Called after the server confirms deletion and the success toast fires. */
|
|
5
|
+
onSuccess?: () => void | Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export interface UseEventDeleteResult {
|
|
8
|
+
/** Delete the event by id, surfacing errors and calling onSuccess when confirmed. */
|
|
9
|
+
onDeleteEvent: (id: string, options?: UseEventDeleteOptions) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Shared event-deletion handler for EventfullyManaged list and detail surfaces.
|
|
13
|
+
*
|
|
14
|
+
* Encapsulates the mutation call, server-error handling, success notification
|
|
15
|
+
* and post-delete callback (list refetch or detail navigation) so the behaviour
|
|
16
|
+
* is testable in isolation and identical across EventsPage and EventDetailPage.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useEventDelete(): UseEventDeleteResult;
|
|
19
|
+
//# sourceMappingURL=useEventDelete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEventDelete.d.ts","sourceRoot":"","sources":["../../../src/eventfullymanaged/hooks/useEventDelete.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,qBAAqB;IACpC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,oBAAoB;IACnC,qFAAqF;IACrF,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAiBrD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { notify as e } from "../lib/toast.js";
|
|
2
|
+
import { useDeleteEventMutation as t } from "../api/eventApi.js";
|
|
3
|
+
import { useCallback as n } from "react";
|
|
4
|
+
//#region src/eventfullymanaged/hooks/useEventDelete.ts
|
|
5
|
+
function r() {
|
|
6
|
+
let [r] = t();
|
|
7
|
+
return { onDeleteEvent: n(async (t, n) => {
|
|
8
|
+
let i = await r({ variables: { id: t } });
|
|
9
|
+
if (i.error || !i.data?.deleteEvent) throw e.error("Could not delete event", i.error?.message ?? "The server did not confirm the change."), i.error ?? /* @__PURE__ */ Error("delete-unconfirmed");
|
|
10
|
+
e.success("Event deleted", n?.name), await n?.onSuccess?.();
|
|
11
|
+
}, [r]) };
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as useEventDelete };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=useEventDelete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEventDelete.js","names":[],"sources":["../../../src/eventfullymanaged/hooks/useEventDelete.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nimport { useDeleteEventMutation } from '../api/eventApi';\nimport { notify } from '../lib/toast';\n\nexport interface UseEventDeleteOptions {\n /** Name shown in the success toast (e.g. \"Event deleted Annual Meetup\"). */\n name?: string;\n /** Called after the server confirms deletion and the success toast fires. */\n onSuccess?: () => void | Promise<void>;\n}\n\nexport interface UseEventDeleteResult {\n /** Delete the event by id, surfacing errors and calling onSuccess when confirmed. */\n onDeleteEvent: (id: string, options?: UseEventDeleteOptions) => Promise<void>;\n}\n\n/**\n * Shared event-deletion handler for EventfullyManaged list and detail surfaces.\n *\n * Encapsulates the mutation call, server-error handling, success notification\n * and post-delete callback (list refetch or detail navigation) so the behaviour\n * is testable in isolation and identical across EventsPage and EventDetailPage.\n */\nexport function useEventDelete(): UseEventDeleteResult {\n const [deleteEvent] = useDeleteEventMutation();\n\n const onDeleteEvent = useCallback(\n async (id: string, options?: UseEventDeleteOptions) => {\n const response = await deleteEvent({ variables: { id } });\n if (response.error || !response.data?.deleteEvent) {\n notify.error('Could not delete event', response.error?.message ?? 'The server did not confirm the change.');\n throw response.error ?? new Error('delete-unconfirmed');\n }\n notify.success('Event deleted', options?.name);\n await options?.onSuccess?.();\n },\n [deleteEvent]\n );\n\n return { onDeleteEvent };\n}\n"],"mappings":";;;;AAwBA,SAAgB,IAAuC;CACrD,IAAM,CAAC,KAAe,GAAwB;AAe9C,QAAO,EAAE,eAba,EACpB,OAAO,GAAY,MAAoC;EACrD,IAAM,IAAW,MAAM,EAAY,EAAE,WAAW,EAAE,OAAI,EAAE,CAAC;AACzD,MAAI,EAAS,SAAS,CAAC,EAAS,MAAM,YAEpC,OADA,EAAO,MAAM,0BAA0B,EAAS,OAAO,WAAW,yCAAyC,EACrG,EAAS,SAAS,gBAAI,MAAM,qBAAqB;AAGzD,EADA,EAAO,QAAQ,iBAAiB,GAAS,KAAK,EAC9C,MAAM,GAAS,aAAa;IAE9B,CAAC,EAAY,CACd,EAEuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/eventfullymanaged/pages/events/EventDetailPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EventDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/eventfullymanaged/pages/events/EventDetailPage.tsx"],"names":[],"mappings":"AAurBA,MAAM,CAAC,OAAO,UAAU,eAAe,4CAsPtC"}
|