From 26f600090997cf71957584d291ef90f7852ed987 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Thu, 19 Nov 2020 23:06:04 +0200 Subject: [PATCH] Change added contract accessors with constants --- packages/concordia-app/src/components/PostCreate/index.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/concordia-app/src/components/PostCreate/index.jsx b/packages/concordia-app/src/components/PostCreate/index.jsx index 0047247..e13f343 100644 --- a/packages/concordia-app/src/components/PostCreate/index.jsx +++ b/packages/concordia-app/src/components/PostCreate/index.jsx @@ -15,8 +15,10 @@ import { breeze, drizzle } from '../../redux/store'; import './styles.css'; import { TRANSACTION_ERROR, TRANSACTION_SUCCESS } from '../../constants/TransactionStatus'; import { POST_CONTENT, POST_SUBJECT } from '../../constants/PostsDatabaseKeys'; +import { FORUM_CONTRACT } from '../../constants/ContractNames'; +import { POST_CREATED_EVENT } from '../../constants/ForumContractEvents'; -const { contracts: { Forum: { methods: { createPost } } } } = drizzle; +const { contracts: { [FORUM_CONTRACT]: { methods: { createPost } } } } = drizzle; const { orbit } = breeze; const PostCreate = (props) => { @@ -86,7 +88,7 @@ const PostCreate = (props) => { setPosting(false); } else if (transactions[transactionStack[createPostCacheSendStackId]].status === TRANSACTION_SUCCESS) { const { - receipt: { events: { PostCreated: { returnValues: { postID: contractPostId } } } }, + receipt: { events: { [POST_CREATED_EVENT]: { returnValues: { postID: contractPostId } } } }, } = transactions[transactionStack[createPostCacheSendStackId]]; const { stores } = orbit;