-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CES-644] List tasks #57
Conversation
🦋 Changeset detectedLatest commit: 648843f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
6d667b1
to
a92f0dc
Compare
pipe( | ||
RTE.ask<Env>(), | ||
// execute use case | ||
RTE.flatMap(listTasks), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: in this case, the listTasks
isn't a use case but a function under the domain
layer.
this is wanted because the use case would be just a wrapper around the function already used, the listTasks
.
If the list
operation is going to be more complicated, with some custom logic before sending the result, then a use case would be the place where to hide that logic.
@@ -12,4 +14,13 @@ export const makeTaskRepository = (container: Container): TaskRepository => ({ | |||
TE.tryCatch(() => container.items.create(task), E.toError), | |||
TE.mapBoth(cosmosErrorToDomainError, () => task), | |||
), | |||
list: () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Currently, due to the goal of this playground, no pagination is available.
If we need that, we are going to update this function
* | ||
* @param codec the io-ts codec to use to decode the resources | ||
*/ | ||
export const decodeFromFeed = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: this function, and also other decode functions, might be in a separate package and could be used to parse what's coming from the CosmosDB server to a well-known domain type.
Add OpenAPI operation to list tasks.
Implement the
list
operation on CosmosDB, to get the persisted tasks