All files / app/service threads.ts

26.66% Statements 4/15
0% Branches 0/1
0% Functions 0/2
26.66% Lines 4/15

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2268x   68x   68x                   68x              
import { GetThreadReq, PostReplyReq } from "proto/threads_pb";
 
import client from "./client";
 
export async function getThread(threadId: number, pageToken?: string) {
  const req = new GetThreadReq();
  req.setThreadId(threadId);
  Iif (pageToken) {
    req.setPageToken(pageToken);
  }
  const response = await client.threads.getThread(req);
  return response.toObject();
}
 
export async function postReply(threadId: number, content: string) {
  const req = new PostReplyReq();
  req.setThreadId(threadId);
  req.setContent(content);
  const response = await client.threads.postReply(req);
  return response.toObject();
}