Skip to content

Commit

Permalink
Remove execute method on requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mvelimir committed Feb 7, 2023
1 parent 595d3be commit 9098283
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 150 deletions.
4 changes: 2 additions & 2 deletions modules/example/src/main/scala/example/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ object Main extends ZIOAppDefault {
val deleteIndex: RIO[ElasticExecutor, Unit] =
for {
_ <- ZIO.logInfo(s"Deleting index '$Index'...")
_ <- ElasticRequest.deleteIndex(Index).execute
_ <- ZIO.serviceWithZIO[ElasticExecutor](_.execute(ElasticRequest.deleteIndex(Index)))
} yield ()

val createIndex: RIO[ElasticExecutor, Unit] =
for {
_ <- ZIO.logInfo(s"Creating index '$Index'...")
mapping <- ZIO.attempt(Source.fromURL(getClass.getResource("/mapping.json")).mkString)
_ <- ElasticRequest.createIndex(Index, Some(mapping)).execute
_ <- ZIO.serviceWithZIO[ElasticExecutor](_.execute(ElasticRequest.createIndex(Index, Some(mapping))))
} yield ()

val populate: RIO[SttpBackend[Task, Any] with ElasticExecutor, Unit] =
Expand Down
Loading

0 comments on commit 9098283

Please sign in to comment.