All files / app/service bugs.ts

25% Statements 3/12
100% Branches 0/0
0% Functions 0/1
25% Lines 3/12

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 22 23  68x   68x   68x                                  
import { BugReportFormData } from "components/Navigation/ReportButton";
import { ReportBugReq } from "proto/bugs_pb";
 
import client from "./client";
 
export async function reportBug({
  description,
  results,
  subject,
}: BugReportFormData) {
  const req = new ReportBugReq();
 
  req.setSubject(subject);
  req.setDescription(description);
  req.setResults(results);
  req.setFrontendVersion(process.env.NEXT_PUBLIC_VERSION);
  req.setUserAgent(navigator.userAgent);
  req.setPage(window.location.href);
 
  const res = await client.bugs.reportBug(req);
  return res.toObject();
}