contentsDocuments
|-/redux
|
|-/contentsDocuments
|- index.ts
|- contentsDocumentsSlice.ts
|- contentsDocumentsThunks.ts
Initial State
const initialState: SliceState = {
documents: {},
publicDocuments: {},
isLoadingContentsDocuments: false,
};
Selectors
getContentsDocumentsByCategory: Retrieves a group of documents links: url o pdf based in the category provided. These documents need the user to be authenticated in the app.
getIsLoadingContentsDocuments: Indicates if the last request to fetch a documents is pending.
getContentsDocumentById: Retrieves the document with link: url based on the id provided. These documents need the user to be authenticated in the app.
getContentsPublicDocumentsByCategory: Retrieves a group of documents links: url o pdf based in the category provided. These documents are not restricted and they have public access.
getContentsPublicDocumentById: Retrieves the document with link: url based on the id provided. These documents are not restricted and they have public access.
Thunks
fetchContentsDocuments
This performs the fetchContentsDocuments request. This thunk can be called from different modules to fetch documents indicating the category and if the documents are restricted by an authenticated user.
fetchContentsDocumentById
This performs the fetchContentsDocumentById request. This thunk can be called from different modules to fetch documents indicating the document Id and if the document is restricted a an authenticated user.
fetchContentsPublicDocuments
This performs the fetchContentsDocuments request. This thunk can be called from different modules to fetch documents indicating the category and if the documents have public access.
fetchContentsPublicDocumentsById
This performs the fetchContentsPublicDocumentById request. This thunk can be called from different modules to fetch documents indicating the document Id and if the document has public access.
Last updated