synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
38 lines (37 loc) • 982 B
JavaScript
import { OAUTH_CLIENT_ACL as i } from "../../../utils/APIConstants.js";
import { http as s, HttpResponse as u } from "msw";
import { mockOAuthClientAcls as c } from "../../mockOAuthClientAcls.js";
function A(t) {
return s.get(
`${t}${i(":id")}`,
({ params: e }) => {
let o = 404, n = {
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
reason: `Mock Service worker could not find an ACL for OAuth client with ID ${e.id}`
};
const r = c.find((l) => l.id === e.id);
return r && (n = r, o = 200), u.json(n, { status: o });
}
);
}
function d(t) {
return s.put(
`${t}${i(":id")}`,
async ({ request: e }) => {
const o = await e.json();
return u.json(o, { status: 200 });
}
);
}
function h(t) {
return [
A(t),
d(t)
];
}
export {
h as getAllOAuthClientAclHandlers,
A as getOAuthClientAclHandler,
d as updateOAuthClientAcl
};
//# sourceMappingURL=oauthClientAclHandlers.js.map