-
Notifications
You must be signed in to change notification settings - Fork 3
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
I added the endpoints for the todos (CURD) and then i added the tod #7
Conversation
…api.yaml file to the array in the generate.js file
Cool! Next step would be to merge IsraelOjiefoh#1, and then proper request, response bodied and status codes! 👍 |
Initial todo api spec
…arams, PUT and DELETE now route by ID
…arams, PUT and DELETE now route by ID
…es. -The todo-item-update schema uses oneOf to handle different required fields depending on the type of update.
… added npm/todo folder to the work-space created client.ts, root.ts, server.ts, and also todo.ts in the operation handler folder. It's time to start working now🚀
Every function of the api is now a seperate operation.
|
||
export const addTodoOperationHandler: api.server.AddTodoItemOperationHandler<{}> = async (todo: string) => { | ||
const createTodoCommand = new CreateTodo(todo); | ||
const commandHandlers = new CommandHandlers(); |
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.
At some point this needs to be scoped to the server lifetime. So every server should have one commandHandlers object. There are various options to do this, like:
- use a global (absolutely not preferred!!)
- a hook (very "cool" and clean solution)
- create operationhandler in a factory, pass the command handlers to the factory
Let's discuss those options later! After implenting all the operationhandlers with dummy / example code
Operation handler update
…res a �undled folder inside the odo-api library but i don't know how to generate it. Please i want us to discuss this!!
use implicit types
|
||
if (this.todos.has(todoId)) { | ||
if (todoToUpdate) { | ||
todoToUpdate.todoName = "Go to the gym"; |
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.
this should be variable
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.
Noted!
continue in #10 |
continue here, #10 is invalid |
I added the endpoints for the todos (CURD) and then i added the todo-api.yaml file to the array in the generate.js file