Skip to content

Commit

Permalink
Update farcaster.js
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed Jun 3, 2024
1 parent 79b4739 commit 1b729a9
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions api/src/controllers/farcaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@ export const createCast = async (req, res, next) => {
...req.body.data,
});

const indexId = `kjzl6kcym7w8y97yfoer7bb20k4j3x3jb64t6nk714879q9cqyr3s8kuhpg9b84`;

const indexId = `kjzl6kcym7w8y97yfoer7bb20k4j3x3jb64t6nk714879q9cqyr3s8kuhpg9b84`
const indexService = new IndexService(definition);
const index = await indexService.getIndexById(indexId);
const pkpSession = await getPKPSessionForIndexer(index);

try {
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);

const itemService = new ItemService(definition).setSession(pkpSession);
const item = await itemService.addItem(indexId, cast.id);

res.status(201).json({ cast, item });
} catch (error) {
res.status(500).json({ error: error.message });
}
};
res.status(201).json({ cast, item });
} catch (error) {
res.status(500).json({ error: error.message });
}
};

0 comments on commit 1b729a9

Please sign in to comment.