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 1b729a9 commit fc3dd51
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions api/src/controllers/farcaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit fc3dd51

Please sign in to comment.