From fc3dd51f63ce740a6bfb883ae450f8026851f03f Mon Sep 17 00:00:00 2001 From: serafettin Date: Sun, 2 Jun 2024 21:21:37 -0400 Subject: [PATCH] Update farcaster.js --- api/src/controllers/farcaster.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/api/src/controllers/farcaster.js b/api/src/controllers/farcaster.js index 4088515d..dad4800e 100644 --- a/api/src/controllers/farcaster.js +++ b/api/src/controllers/farcaster.js @@ -12,21 +12,19 @@ export const createCast = async (req, res, next) => { //todo get fragment try { + const indexId = `kjzl6kcym7w8y97yfoer7bb20k4j3x3jb64t6nk714879q9cqyr3s8kuhpg9b84`; + const indexService = new IndexService(definition); + const index = await indexService.getIndexById(indexId); + const pkpSession = await getPKPSessionForIndexer(index); const composeDBService = new ComposeDBService( definition, castFragment, - ).setSession(req.session); + ).setSession(pkpSession); const cast = await composeDBService.createNode({ ...req.body.data, }); - const indexId = `kjzl6kcym7w8y97yfoer7bb20k4j3x3jb64t6nk714879q9cqyr3s8kuhpg9b84`; - - const indexService = new IndexService(definition); - const index = await indexService.getIndexById(indexId); - const pkpSession = await getPKPSessionForIndexer(index); - const itemService = new ItemService(definition).setSession(pkpSession); const item = await itemService.addItem(indexId, cast.id);