- LOAD_DETAILS: ofType<{ uuid: string, kind: ResourceKind }>(),
- LOAD_DETAILS_SUCCESS: ofType<{ item: Resource }>(),
-}, { tag: 'type', value: 'payload' });
-
-export default actions;
-
-export type DetailsPanelAction = UnionOf<typeof actions>;
-
-export const loadDetails = (uuid: string, kind: ResourceKind) =>
- (dispatch: Dispatch) => {
- dispatch(actions.LOAD_DETAILS({ uuid, kind }));
- getService(kind)
- .get(uuid)
- .then(project => {
- dispatch(actions.LOAD_DETAILS_SUCCESS({ item: project }));
- });
- };
-
-const getService = (kind: ResourceKind) => {
- switch (kind) {
- case ResourceKind.Project:
- return new CommonResourceService(serverApi, "groups");
- case ResourceKind.Collection:
- return new CommonResourceService(serverApi, "collections");
- default:
- return new CommonResourceService(serverApi, "");
- }
-};
+ LOAD_DETAILS_PANEL: ofType<string>()
+});
+
+export type DetailsPanelAction = UnionOf<typeof detailsPanelActions>;
+
+export const loadDetailsPanel = (uuid: string) => detailsPanelActions.LOAD_DETAILS_PANEL(uuid);
+