MCPcopy
hub / github.com/Effect-TS/effect / createTodo

Function createTodo

packages/platform-node/test/HttpClient.test.ts:26–31  ·  view source on GitHub ↗
(todo: typeof TodoWithoutId.Type)

Source from the content-addressed store, hash-verified

24 HttpClient.mapRequest(HttpClientRequest.prependUrl("https://jsonplaceholder.typicode.com"))
25 )
26 const createTodo = (todo: typeof TodoWithoutId.Type) =>
27 HttpClientRequest.post("/todos").pipe(
28 HttpClientRequest.schemaBodyJson(TodoWithoutId)(todo),
29 Effect.flatMap(client.execute),
30 Effect.flatMap(HttpClientResponse.schemaBodyJson(Todo))
31 )
32 return {
33 client,
34 createTodo

Callers

nothing calls this directly

Calls 1

pipeMethod · 0.65

Tested by

no test coverage detected