Skip to content

Commit

Permalink
fix: read time
Browse files Browse the repository at this point in the history
  • Loading branch information
subhamX committed Sep 3, 2022
1 parent 83ddf1a commit 4c8d3ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/resolvers/devResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,8 @@ export const devResolvers = {
throw new Error("Invalid Id or permissions");
}

post.approx_read_time_in_minutes = 5; // TODO: fix it
const length= params.payload.desc_full_markdown.length;
post.approx_read_time_in_minutes = Math.ceil(length/500);
post.creator_id = ctx.user.id;
post.title = params.payload.title;
post.desc_full_markdown = params.payload.desc_full_markdown;
Expand Down

0 comments on commit 4c8d3ad

Please sign in to comment.