From 380655ccd046b6a6b58dad49c9957f96ec15d99f Mon Sep 17 00:00:00 2001 From: GitHub -- tdilauro Date: Mon, 8 Jul 2024 17:49:23 -0400 Subject: [PATCH] WIP - more RTK Query. --- src/actions.ts | 44 +++--- src/components/BookDetailsEditor.tsx | 78 +++++++--- src/components/CustomLists.tsx | 218 +++++++++++++++------------ src/components/Libraries.tsx | 62 ++++---- src/features/api/admin.ts | 15 ++ src/reducers/index.ts | 18 +-- src/reducers/languages.ts | 10 +- src/reducers/media.ts | 10 +- src/reducers/roles.ts | 10 +- 9 files changed, 271 insertions(+), 194 deletions(-) create mode 100644 src/features/api/admin.ts diff --git a/src/actions.ts b/src/actions.ts index 6cfd065b5..203ceba54 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -14,9 +14,9 @@ import { CustomListsData, LanesData, LaneData, - RolesData, - MediaData, - LanguagesData, + // RolesData, + // MediaData, + // LanguagesData, RightsStatusData, CatalogServicesData, SelfTestsData, @@ -46,9 +46,9 @@ export default class ActionCreator extends BaseActionCreator { static readonly UPDATE_CLEAR_FILTERS_FLAG = "UPDATE_CLEAR_FILTERS_FLAG"; static readonly EDIT_BOOK = "EDIT_BOOK"; static readonly BOOK_ADMIN = "BOOK_ADMIN"; - static readonly ROLES = "ROLES"; - static readonly MEDIA = "MEDIA"; - static readonly LANGUAGES = "LANGUAGES"; + // static readonly ROLES = "ROLES"; + // static readonly MEDIA = "MEDIA"; + // static readonly LANGUAGES = "LANGUAGES"; static readonly RIGHTS_STATUSES = "RIGHTS_STATUSES"; static readonly COMPLAINTS = "COMPLAINTS"; static readonly POST_COMPLAINT = "POST_COMPLAINT"; @@ -320,22 +320,22 @@ export default class ActionCreator extends BaseActionCreator { }; } - fetchRoles() { - const url = "/admin/roles"; - return this.fetchJSON(ActionCreator.ROLES, url).bind(this); - } - - fetchMedia() { - const url = "/admin/media"; - return this.fetchJSON(ActionCreator.MEDIA, url).bind(this); - } - - fetchLanguages() { - const url = "/admin/languages"; - return this.fetchJSON(ActionCreator.LANGUAGES, url).bind( - this - ); - } + // fetchRoles() { + // const url = "/admin/roles"; + // return this.fetchJSON(ActionCreator.ROLES, url).bind(this); + // } + // + // fetchMedia() { + // const url = "/admin/media"; + // return this.fetchJSON(ActionCreator.MEDIA, url).bind(this); + // } + // + // fetchLanguages() { + // const url = "/admin/languages"; + // return this.fetchJSON(ActionCreator.LANGUAGES, url).bind( + // this + // ); + // } fetchRightsStatuses() { const url = "/admin/rights_status"; diff --git a/src/components/BookDetailsEditor.tsx b/src/components/BookDetailsEditor.tsx index 750e10c79..e384c795b 100644 --- a/src/components/BookDetailsEditor.tsx +++ b/src/components/BookDetailsEditor.tsx @@ -12,6 +12,7 @@ import UpdatingLoader from "./UpdatingLoader"; import { getBookData, submitBookData } from "../features/book/bookEditorSlice"; import BookDetailsEditorSuppression from "./BookDetailsEditorSuppression"; import { bookEditorApiEndpoints } from "../features/book/bookEditorSlice"; +import { adminApi } from "../features/api/admin"; export interface BookDetailsEditorOwnProps { bookUrl?: string; @@ -26,6 +27,11 @@ export type BookDetailsEditorProps = ConnectedProps & /** Tab for editing a book's metadata on the book details page. */ export class BookDetailsEditor extends React.Component { + // RTK Query subscriptions. + rolesSubscription; + mediaSubscription; + languagesSubscription; + constructor(props: BookDetailsEditorProps) { super(props); this.postWithoutPayload = this.postWithoutPayload.bind(this); @@ -33,15 +39,15 @@ export class BookDetailsEditor extends React.Component { this.restore = this.restore.bind(this); this.refreshMetadata = this.refreshMetadata.bind(this); this.refresh = this.refresh.bind(this); + this.subscribe = this.subscribe.bind(this); + this.unsubscribe = this.unsubscribe.bind(this); } UNSAFE_componentWillMount() { if (this.props.bookUrl) { const bookAdminUrl = this.props.bookUrl.replace("works", "admin/works"); this.props.fetchBookData(bookAdminUrl); - this.props.fetchRoles(); - this.props.fetchMedia(); - this.props.fetchLanguages(); + this.subscribe(); } } @@ -52,8 +58,31 @@ export class BookDetailsEditor extends React.Component { } } + componentWillUnmount() { + this.unsubscribe(); + } + + subscribe() { + // subscribe to RTK Query caches and fetch, as needed. + this.rolesSubscription = this.props.fetchRoles(); + this.mediaSubscription = this.props.fetchMedia(); + this.languagesSubscription = this.props.fetchLanguages(); + } + + unsubscribe() { + // Unsubscribe from the RTK Query caches. + this.rolesSubscription.unsubscribe(); + this.mediaSubscription.unsubscribe(); + this.languagesSubscription.unsubscribe(); + } + render(): React.ReactElement { const { bookData } = this.props; + const errorString = + "response" in this.props.fetchError && + typeof this.props.fetchError.response === "string" + ? this.props.fetchError.response + : JSON.stringify(this.props.fetchError); return (
{bookData && !this.props.fetchError && ( @@ -144,9 +173,9 @@ export class BookDetailsEditor extends React.Component { {bookData.editLink && ( { )} {this.props.fetchError && ( - + )}
); @@ -184,22 +220,26 @@ export class BookDetailsEditor extends React.Component { } function mapStateToProps(state: RootState) { + const roles = adminApi.endpoints.getRoles.select()(state); + const media = adminApi.endpoints.getMedia.select()(state); + const languages = adminApi.endpoints.getLanguages.select()(state); + return { bookAdminUrl: state.bookEditor.url, bookData: state.bookEditor.data, - roles: state.editor.roles.data, - media: state.editor.media.data, - languages: state.editor.languages.data, + roles, + media, + languages, isFetching: state.bookEditor.isFetching || - state.editor.roles.isFetching || - state.editor.media.isFetching || - state.editor.languages.isFetching, + roles.isLoading || + media.isLoading || + languages.isLoading, fetchError: state.bookEditor.fetchError || - state.editor.roles.fetchError || - state.editor.media.fetchError || - state.editor.languages.fetchError, + roles.error || + media.error || + languages.error, editError: state.bookEditor.editError, }; } @@ -214,9 +254,9 @@ function mapDispatchToProps( postBookData: (url: string, data: FormData | null) => dispatch(submitBookData({ url, data, csrfToken: ownProps.csrfToken })), fetchBookData: (url: string) => dispatch(getBookData({ url })), - fetchRoles: () => dispatch(actions.fetchRoles()), - fetchMedia: () => dispatch(actions.fetchMedia()), - fetchLanguages: () => dispatch(actions.fetchLanguages()), + fetchRoles: () => dispatch(adminApi.endpoints.getLanguages.initiate()), + fetchMedia: () => dispatch(adminApi.endpoints.getMedia.initiate()), + fetchLanguages: () => dispatch(adminApi.endpoints.getRoles.initiate()), suppressBook: (url: string) => dispatch( bookEditorApiEndpoints.endpoints.suppressBook.initiate({ diff --git a/src/components/CustomLists.tsx b/src/components/CustomLists.tsx index c1cb3e843..b936d3c33 100644 --- a/src/components/CustomLists.tsx +++ b/src/components/CustomLists.tsx @@ -1,9 +1,9 @@ /* eslint-disable react/no-deprecated */ import * as React from "react"; import { Store } from "@reduxjs/toolkit"; -import { connect } from "react-redux"; +import { connect, ConnectedProps } from "react-redux"; import * as PropTypes from "prop-types"; -import { RootState } from "../store"; +import { AppDispatch, RootState } from "../store"; import ActionCreator from "../actions"; import DataFetcher from "@thepalaceproject/web-opds-client/lib/DataFetcher"; import { adapter } from "@thepalaceproject/web-opds-client/lib/OPDSDataAdapter"; @@ -32,82 +32,85 @@ import CustomListEditor from "./CustomListEditor"; import LoadingIndicator from "@thepalaceproject/web-opds-client/lib/components/LoadingIndicator"; import ErrorMessage from "./ErrorMessage"; import CustomListsSidebar from "./CustomListsSidebar"; - -export interface CustomListsStateProps { - customListEditorAutoUpdateStatus?: string; - customListEditorProperties?: CustomListEditorProperties; - customListEditorSavedName?: string; - customListEditorSearchParams?: CustomListEditorSearchParams; - customListEditorEntries?: CustomListEditorEntriesData; - customListEditorIsLoaded?: boolean; - customListEditorIsOwner?: boolean; - customListEditorIsShared?: boolean; - customListEditorIsSharePending?: boolean; - customListEditorIsValid?: boolean; - customListEditorIsModified?: boolean; - customListEditorIsSearchModified?: boolean; - customListEditorIsAutoUpdateEnabled?: boolean; - FiltersEnabled?: boolean; - lists: CustomListData[]; - listDetails?: CollectionData; - collections: AdminCollectionData[]; - searchResults: CollectionData; - fetchError?: FetchErrorData; - isFetching: boolean; - isFetchingSearchResults: boolean; - isFetchingMoreSearchResults: boolean; - isFetchingMoreCustomListEntries: boolean; - libraries?: LibraryData[]; - lanes?: LaneData[]; - languages?: LanguagesData; -} - -export interface CustomListsDispatchProps { - fetchLanes: () => Promise; - fetchCustomLists: () => Promise; - fetchCustomListDetails: (listId: string) => Promise; - openCustomListEditor: (listId: string) => void; - saveCustomListEditor: () => Promise; - resetCustomListEditor?: () => void; - executeCustomListEditorSearch?: () => void; - updateCustomListEditorProperty?: (name: string, value) => void; - toggleCustomListEditorCollection?: (id: number) => void; - updateCustomListEditorSearchParam?: (name: string, value) => void; - addCustomListEditorAdvSearchQuery?: ( - builderName: string, - query: AdvancedSearchQuery - ) => void; - updateClearFiltersFlag?: (builderName: string, value: boolean) => void; - updateCustomListEditorAdvSearchQueryBoolean?: ( - builderName: string, - id: string, - bool: string - ) => void; - moveCustomListEditorAdvSearchQuery?: ( - builderName: string, - id: string, - targetId: string - ) => void; - removeCustomListEditorAdvSearchQuery?: ( - builderName: string, - id: string - ) => void; - selectCustomListEditorAdvSearchQuery?: ( - builderName: string, - id: string - ) => void; - addCustomListEditorEntry?: (id: string) => void; - addAllCustomListEditorEntries?: () => void; - deleteCustomListEditorEntry?: (id: string) => void; - deleteAllCustomListEditorEntries?: () => void; - deleteCustomList: (listId: string) => Promise; - shareCustomList?: (listId: string) => Promise; - loadMoreSearchResults: () => void; - loadMoreEntries: () => void; - fetchCollections: () => Promise; - fetchLibraries: () => void; - fetchLanguages: () => void; -} +import { adminApi } from "../features/api/admin"; +import { BookDetailsEditorOwnProps } from "./BookDetailsEditor"; +import { Root } from "@thepalaceproject/web-opds-client/lib/components/Root"; + +// export interface CustomListsStateProps { +// customListEditorAutoUpdateStatus?: string; +// customListEditorProperties?: CustomListEditorProperties; +// customListEditorSavedName?: string; +// customListEditorSearchParams?: CustomListEditorSearchParams; +// customListEditorEntries?: CustomListEditorEntriesData; +// customListEditorIsLoaded?: boolean; +// customListEditorIsOwner?: boolean; +// customListEditorIsShared?: boolean; +// customListEditorIsSharePending?: boolean; +// customListEditorIsValid?: boolean; +// customListEditorIsModified?: boolean; +// customListEditorIsSearchModified?: boolean; +// customListEditorIsAutoUpdateEnabled?: boolean; +// FiltersEnabled?: boolean; +// lists: CustomListData[]; +// listDetails?: CollectionData; +// collections: AdminCollectionData[]; +// searchResults: CollectionData; +// fetchError?: FetchErrorData; +// isFetching: boolean; +// isFetchingSearchResults: boolean; +// isFetchingMoreSearchResults: boolean; +// isFetchingMoreCustomListEntries: boolean; +// libraries?: LibraryData[]; +// lanes?: LaneData[]; +// languages?: LanguagesData; +// } + +// export interface CustomListsDispatchProps { +// fetchLanes: () => Promise; +// fetchCustomLists: () => Promise; +// fetchCustomListDetails: (listId: string) => Promise; +// openCustomListEditor: (listId: string) => void; +// saveCustomListEditor: () => Promise; +// resetCustomListEditor?: () => void; +// executeCustomListEditorSearch?: () => void; +// updateCustomListEditorProperty?: (name: string, value) => void; +// toggleCustomListEditorCollection?: (id: number) => void; +// updateCustomListEditorSearchParam?: (name: string, value) => void; +// addCustomListEditorAdvSearchQuery?: ( +// builderName: string, +// query: AdvancedSearchQuery +// ) => void; +// updateClearFiltersFlag?: (builderName: string, value: boolean) => void; +// updateCustomListEditorAdvSearchQueryBoolean?: ( +// builderName: string, +// id: string, +// bool: string +// ) => void; +// moveCustomListEditorAdvSearchQuery?: ( +// builderName: string, +// id: string, +// targetId: string +// ) => void; +// removeCustomListEditorAdvSearchQuery?: ( +// builderName: string, +// id: string +// ) => void; +// selectCustomListEditorAdvSearchQuery?: ( +// builderName: string, +// id: string +// ) => void; +// addCustomListEditorEntry?: (id: string) => void; +// addAllCustomListEditorEntries?: () => void; +// deleteCustomListEditorEntry?: (id: string) => void; +// deleteAllCustomListEditorEntries?: () => void; +// deleteCustomList: (listId: string) => Promise; +// shareCustomList?: (listId: string) => Promise; +// loadMoreSearchResults: () => void; +// loadMoreEntries: () => void; +// fetchCollections: () => Promise; +// fetchLibraries: () => void; +// fetchLanguages: () => void; +// } export interface CustomListsOwnProps { store?: Store; @@ -118,17 +121,21 @@ export interface CustomListsOwnProps { startingTitle?: string; } -export interface CustomListsProps - extends React.Props, - CustomListsStateProps, - CustomListsDispatchProps, - CustomListsOwnProps {} +// export interface CustomListsProps +// extends React.Props, +// CustomListsStateProps, +// CustomListsDispatchProps, +// CustomListsOwnProps {} export interface CustomListsState { filter: string; sort: string; } +const connector = connect(mapStateToProps, mapDispatchToProps); +export type CustomListsProps = ConnectedProps & + CustomListsOwnProps; + /** Body of the custom lists page, with all a library's lists shown in a left sidebar and a list editor on the right. */ export class CustomLists extends React.Component< @@ -136,6 +143,7 @@ export class CustomLists extends React.Component< CustomListsState > { context: { admin: Admin }; + languagesSubscription; static contextTypes = { admin: PropTypes.object.isRequired, @@ -148,12 +156,25 @@ export class CustomLists extends React.Component< this.changeFilter = this.changeFilter.bind(this); this.changeSort = this.changeSort.bind(this); this.getEnabledEntryPoints = this.getEnabledEntryPoints.bind(this); + this.subscribe = this.subscribe.bind(this); + this.unsubscribe = this.unsubscribe.bind(this); + this.state = { filter: "owned", sort: "asc", }; } + subscribe() { + // Subscribe to RTK Query caches and fetch, as needed. + this.languagesSubscription = this.props.fetchLanguages(); + } + + unsubscribe() { + // Unsubscribe from RTK Query caches. + this.languagesSubscription.unsubscribe(); + } + render(): JSX.Element { return (
@@ -210,7 +231,7 @@ export class CustomLists extends React.Component< .isFetchingMoreCustomListEntries, isFetchingSearchResults: this.props.isFetchingSearchResults, isFetchingMoreSearchResults: this.props.isFetchingMoreSearchResults, - languages: this.props.languages, + languages: this.props.languages.data, library: this.props.libraries?.find( (l) => l.short_name === this.props.library ), @@ -266,7 +287,8 @@ export class CustomLists extends React.Component< fetchCollections?.(); fetchLibraries?.(); - fetchLanguages?.(); + + this.subscribe(); } UNSAFE_componentWillReceiveProps(nextProps) { @@ -303,6 +325,10 @@ export class CustomLists extends React.Component< } } + componentWillUnmount() { + this.unsubscribe(); + } + changeFilter(filter) { this.setState({ filter }); } @@ -444,7 +470,7 @@ export class CustomLists extends React.Component< } } -function mapStateToProps(state, ownProps) { +function mapStateToProps(state: RootState, ownProps: CustomListsOwnProps) { return { customListEditorProperties: state.editor.customListEditor.properties.current, @@ -492,14 +518,17 @@ function mapStateToProps(state, ownProps) { state.editor.collections && state.editor.collections.data && state.editor.collections.data.collections, - languages: state.editor.languages && state.editor.languages.data, + languages: adminApi.endpoints.getLanguages.select()(state), libraries: state.editor.libraries.data && state.editor.libraries.data.libraries, lanes: state.editor.lanes.data && state.editor.lanes.data.lanes, }; } -function mapDispatchToProps(dispatch, ownProps) { +function mapDispatchToProps( + dispatch: AppDispatch, + ownProps: CustomListsOwnProps +) { const fetcher = new DataFetcher({ adapter }); const actions = new ActionCreator(fetcher, ownProps.csrfToken); return { @@ -527,7 +556,7 @@ function mapDispatchToProps(dispatch, ownProps) { fetchCollections: () => dispatch(actions.fetchCollections()), fetchLibraries: () => dispatch(actions.fetchLibraries()), fetchLanes: () => dispatch(actions.fetchLanes(ownProps.library)), - fetchLanguages: () => dispatch(actions.fetchLanguages()), + fetchLanguages: () => dispatch(adminApi.endpoints.getRoles.initiate()), updateCustomListEditorProperty: (name: string, value) => dispatch(actions.updateCustomListEditorProperty(name, value)), toggleCustomListEditorCollection: (id: number) => @@ -587,13 +616,4 @@ function mapDispatchToProps(dispatch, ownProps) { }; } -const ConnectedCustomLists = connect< - CustomListsStateProps, - CustomListsDispatchProps, - CustomListsOwnProps ->( - mapStateToProps, - mapDispatchToProps -)(CustomLists as any); - -export default ConnectedCustomLists; +export default connector(CustomLists as any); diff --git a/src/components/Libraries.tsx b/src/components/Libraries.tsx index 406ac9b28..cd5399538 100644 --- a/src/components/Libraries.tsx +++ b/src/components/Libraries.tsx @@ -5,31 +5,22 @@ import { EditableConfigListDispatchProps, EditableConfigListOwnProps, } from "./EditableConfigList"; -import { connect } from "react-redux"; +import { connect, ConnectedProps } from "react-redux"; import * as PropTypes from "prop-types"; import ActionCreator from "../actions"; import { LibrariesData, LibraryData, LanguagesData } from "../interfaces"; import Admin from "../models/Admin"; import LibraryEditForm from "./LibraryEditForm"; +import { adminApi } from "../features/api/admin"; +import { AppDispatch, RootState } from "../store"; /** Right panel for library configuration on the system configuration page. Shows a list of current libraries and allows creating a new library or editing or deleting an existing library. */ -export interface LibrariesStateProps - extends EditableConfigListStateProps { - additionalData?: LanguagesData; -} - -export interface LibrariesDispatchProps - extends EditableConfigListDispatchProps { - fetchLanguages: () => void; -} - -export interface LibrariesProps - extends LibrariesStateProps, - LibrariesDispatchProps, - EditableConfigListOwnProps {} +const connector = connect(mapStateToProps, mapDispatchToProps); +export type LibrariesProps = ConnectedProps & + EditableConfigListOwnProps; export class Libraries extends GenericEditableConfigList< LibrariesData, @@ -48,9 +39,26 @@ export class Libraries extends GenericEditableConfigList< admin: PropTypes.object.isRequired, }; + // RTK Query subscriptions. + languagesSubscription; + UNSAFE_componentWillMount() { super.UNSAFE_componentWillMount(); - this.props.fetchLanguages(); + this.subscribe(); + } + + componentWillUnmount() { + this.unsubscribe(); + } + + subscribe() { + // Subscribe to RTK Query caches and fetch, as needed. + this.languagesSubscription = this.props.fetchLanguages(); + } + + unsubscribe() { + // Unsubscribe from RTK Query caches. + this.languagesSubscription.unsubscribe(); } label(item): string { @@ -66,7 +74,7 @@ export class Libraries extends GenericEditableConfigList< } } -function mapStateToProps(state, ownProps) { +function mapStateToProps(state: RootState) { // fetchError = an error involving loading the list of libraries; formError = an error upon submission of the // create/edit form. return { @@ -77,28 +85,22 @@ function mapStateToProps(state, ownProps) { formError: state.editor.libraries.formError, isFetching: state.editor.libraries.isFetching || state.editor.libraries.isEditing, - additionalData: state.editor.languages && state.editor.languages.data, + additionalData: adminApi.endpoints.getLanguages.select()(state).data, }; } -function mapDispatchToProps(dispatch, ownProps) { +function mapDispatchToProps( + dispatch: AppDispatch, + ownProps: EditableConfigListOwnProps +) { const actions = new ActionCreator(null, ownProps.csrfToken); return { fetchData: () => dispatch(actions.fetchLibraries()), editItem: (data: FormData) => dispatch(actions.editLibrary(data)), deleteItem: (identifier: string | number) => dispatch(actions.deleteLibrary(identifier)), - fetchLanguages: () => dispatch(actions.fetchLanguages()), + fetchLanguages: () => dispatch(adminApi.endpoints.getRoles.initiate()), }; } -const ConnectedLibraries = connect< - EditableConfigListStateProps, - EditableConfigListDispatchProps, - EditableConfigListOwnProps ->( - mapStateToProps, - mapDispatchToProps -)(Libraries); - -export default ConnectedLibraries; +export default connector(Libraries); diff --git a/src/features/api/admin.ts b/src/features/api/admin.ts new file mode 100644 index 000000000..c42ff0026 --- /dev/null +++ b/src/features/api/admin.ts @@ -0,0 +1,15 @@ +import { api } from "./apiSlice"; + +export const adminApi = api.injectEndpoints({ + endpoints: (builder) => ({ + getLanguages: builder.query({ + query: (arg: void) => "/admin/languages", + }), + getMedia: builder.query({ + query: (arg: void) => "/admin/media", + }), + getRoles: builder.query({ + query: (arg: void) => "/admin/roles", + }), + }), +}); diff --git a/src/reducers/index.ts b/src/reducers/index.ts index e766a191a..b11fc84f5 100644 --- a/src/reducers/index.ts +++ b/src/reducers/index.ts @@ -27,9 +27,9 @@ import laneVisibility from "./laneVisibility"; import resetLanes from "./resetLanes"; import laneOrder from "./laneOrder"; import selfTests from "./selfTests"; -import roles from "./roles"; -import media from "./media"; -import languages from "./languages"; +// import roles from "./roles"; +// import media from "./media"; +// import languages from "./languages"; import rightsStatuses from "./rightsStatuses"; import collection, { CollectionState, @@ -90,9 +90,9 @@ export interface State { resetLanes: FetchEditState; laneOrder: FetchEditState; selfTests: FetchEditState; - roles: FetchEditState; - media: FetchEditState; - languages: FetchEditState; + // roles: FetchEditState; + // media: FetchEditState; + // languages: FetchEditState; rightsStatuses: FetchEditState; changePassword: FetchEditState; patronManager: FetchEditState; @@ -126,9 +126,9 @@ export default combineReducers({ resetLanes, laneOrder, selfTests, - roles, - media, - languages, + // roles, + // media, + // languages, rightsStatuses, changePassword, patronManager, diff --git a/src/reducers/languages.ts b/src/reducers/languages.ts index 7e50fefba..504f44cde 100644 --- a/src/reducers/languages.ts +++ b/src/reducers/languages.ts @@ -1,5 +1,5 @@ -import { LanguagesData } from "../interfaces"; -import ActionCreator from "../actions"; -import createFetchEditReducer from "./createFetchEditReducer"; - -export default createFetchEditReducer(ActionCreator.LANGUAGES); +// import { LanguagesData } from "../interfaces"; +// import ActionCreator from "../actions"; +// import createFetchEditReducer from "./createFetchEditReducer"; +// +// export default createFetchEditReducer(ActionCreator.LANGUAGES); diff --git a/src/reducers/media.ts b/src/reducers/media.ts index 6e2d96838..b7cbc5058 100644 --- a/src/reducers/media.ts +++ b/src/reducers/media.ts @@ -1,5 +1,5 @@ -import { MediaData } from "../interfaces"; -import ActionCreator from "../actions"; -import createFetchEditReducer from "./createFetchEditReducer"; - -export default createFetchEditReducer(ActionCreator.MEDIA); +// import { MediaData } from "../interfaces"; +// import ActionCreator from "../actions"; +// import createFetchEditReducer from "./createFetchEditReducer"; +// +// export default createFetchEditReducer(ActionCreator.MEDIA); diff --git a/src/reducers/roles.ts b/src/reducers/roles.ts index f8847b9ad..071f4adfb 100644 --- a/src/reducers/roles.ts +++ b/src/reducers/roles.ts @@ -1,5 +1,5 @@ -import { RolesData } from "../interfaces"; -import ActionCreator from "../actions"; -import createFetchEditReducer from "./createFetchEditReducer"; - -export default createFetchEditReducer(ActionCreator.ROLES); +// import { RolesData } from "../interfaces"; +// import ActionCreator from "../actions"; +// import createFetchEditReducer from "./createFetchEditReducer"; +// +// export default createFetchEditReducer(ActionCreator.ROLES);