executePostIt method
Future<void>
executePostIt(
- BuildContext context,
- PostActionModel action,
- LoggedIn accessState,
- PostAccessibleByGroup postAccessibleByGroup,
Implementation
Future<void> executePostIt(BuildContext context, PostActionModel action,
LoggedIn accessState, PostAccessibleByGroup postAccessibleByGroup) async {
var pageContextInfo = eliudrouter.Router.getPageContextInfo(context);
var postAppId = pageContextInfo.appId;
var postPageId = pageContextInfo.pageId;
var parameters = pageContextInfo.parameters;
// What is the current page?
// Can we actually add the current page? (page should have an indicator if it's allowed to be added)
postRepository(appId: action.app.documentID)!.add(PostModel(
documentID: newRandomKey(),
authorId: accessState.member.documentID,
appId: action.app.documentID,
postAppId: postAppId,
feedId: action.feed!.documentID,
postPageId: postPageId,
archived: PostArchiveStatus.active,
pageParameters: parameters,
description: "Post added by Add To Post button",
accessibleByGroup: postAccessibleByGroup,
readAccess: [accessState.member.documentID]));
}