Skip to content

Commit 5ec36c4

Browse files
committed
Update types
1 parent 580abb4 commit 5ec36c4

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

_project/api/_src/Usecases/Blog.Controllers.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@ const { controllers, matchWithServices } = matchFor(BlogRsc)
99

1010
const FindPost = matchWithServices("FindPost")(
1111
{ BlogPostRepo },
12-
(req, { BlogPostRepo }) =>
13-
BlogPostRepo.find(req.id)
12+
(req, { blogPostRepo }) =>
13+
blogPostRepo.find(req.id)
1414
.map(_ => _.getOrNull)
1515
)
1616

1717
const GetPosts = matchWithServices("GetPosts")(
1818
{ BlogPostRepo },
19-
(_, { BlogPostRepo }) => BlogPostRepo.all.map(items => ({ items }))
19+
(_, { blogPostRepo }) => blogPostRepo.all.map(items => ({ items }))
2020
)
2121

2222
const CreatePost = matchWithServices("CreatePost")(
2323
{ BlogPostRepo },
24-
(req, { BlogPostRepo }) =>
24+
(req, { blogPostRepo }) =>
2525
Effect(new BlogPost({ ...req }))
26-
.tap(BlogPostRepo.save)
26+
.tap(blogPostRepo.save)
2727
.map(_ => _.id)
2828
)
2929

3030
const PublishPost = matchWithServices("PublishPost")(
3131
{ BlogPostRepo, Events, Operations },
32-
(req, { BlogPostRepo, Events, Operations }) =>
32+
(req, { blogPostRepo, events, operations }) =>
3333
Do($ => {
3434
$(
35-
BlogPostRepo.find(req.id)
35+
blogPostRepo.find(req.id)
3636
.flatMap(_ => _.encaseInEffect(() => new NotFoundError("BlogPost", req.id)))
3737
)
3838

@@ -47,15 +47,15 @@ const PublishPost = matchWithServices("PublishPost")(
4747
const operationId = $(
4848
Effect.forkOperationWithEffect(
4949
opId =>
50-
Operations.update(opId, {
50+
operations.update(opId, {
5151
total: PositiveInt(targets.length),
5252
completed: PositiveInt(done.length)
5353
}) >
5454
targets
5555
.forEachEffect(_ =>
5656
Effect(done.push(_))
5757
.tap(() =>
58-
Operations.update(opId, {
58+
operations.update(opId, {
5959
total: PositiveInt(targets.length),
6060
completed: PositiveInt(done.length)
6161
})
@@ -65,7 +65,7 @@ const PublishPost = matchWithServices("PublishPost")(
6565
.map(() => "the answer to the universe is 41"),
6666
// while operation is running...
6767
_opId =>
68-
Effect.suspendSucceed(() => Events.publish(new BogusEvent({})))
68+
Effect.suspendSucceed(() => events.publish(new BogusEvent({})))
6969
.delay(DUR.seconds(1))
7070
.forever
7171
)

_project/models/_src/Blog.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@ export namespace BlogPost {
3535
readonly title: string
3636
}
3737
export const Encoded: EncodedOps = { $: {} }
38-
/**
39-
* @tsplus type BlogPost.Encoded/Aspects
40-
*/
41-
export interface EncodedAspects {}
4238
/**
4339
* @tsplus type BlogPost.Encoded/Ops
4440
*/
45-
export interface EncodedOps { $: EncodedAspects }
41+
export interface EncodedOps {}
4642
export interface ConstructorInput
4743
extends ConstructorInputFromApi<typeof BlogPost> {}
4844
export interface Props extends GetProvidedProps<typeof BlogPost> {}

_project/resources/_src/Blog/GetPosts.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,10 @@ export namespace GetPostsResponse {
2626
readonly items: readonly BlogPost.Encoded[]
2727
}
2828
export const Encoded: EncodedOps = { $: {} }
29-
/**
30-
* @tsplus type GetPostsResponse.Encoded/Aspects
31-
*/
32-
export interface EncodedAspects {}
3329
/**
3430
* @tsplus type GetPostsResponse.Encoded/Ops
3531
*/
36-
export interface EncodedOps { $: EncodedAspects }
32+
export interface EncodedOps {}
3733
export interface ConstructorInput
3834
extends ConstructorInputFromApi<typeof GetPostsResponse> {}
3935
export interface Props extends GetProvidedProps<typeof GetPostsResponse> {}

0 commit comments

Comments
 (0)