UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

38 lines (37 loc) 1.02 kB
import { EVALUATION_BY_ID as l, EVALUATION as c } from "../../../utils/APIConstants.js"; import { http as u, HttpResponse as a } from "msw"; import { mockEvaluations as o } from "../../entity/mockEvaluationQueue.js"; function f(r) { return [ /** * Get by ID */ u.get( `${r}${l(":evaluationId")}`, ({ params: e }) => { let t = 404, s = { concreteType: "org.sagebionetworks.repo.model.ErrorResponse", reason: `Mock Service worker could not find a mock evaluation queue with ID ${e.evaluationId}` }; const n = o.find( (i) => i.id === e.entityId ); return n && (s = n, t = 200), a.json(s, { status: t }); } ), /** * Get paginated list */ u.get(`${r}${c}`, () => { const t = { results: o, totalNumberOfResults: o.length }; return a.json(t, { status: 200 }); }) ]; } export { f as getEvaluationHandlers }; //# sourceMappingURL=evaluationHandlers.js.map