Hi, I want to use orpc only for clients, but I don't want to add extra bundle to parse the response, is that possible? e.g.
// or maybe you can use `HttpError` as the default error response?
type HttpError = {
message: string
}
type FilterTodo = {
search: string
}
type Todo = {
id: number
title: string
completed: boolean
}
const contract = oc.router({
todo: oc.router({
all: oc.route({ method: 'GET', path: '/todos' })
.input<Partial<FilterTodo>>()
.output<Todo[], HttpError>(),
create: oc
.route({ method: 'POST', path: '/todos' })
.input<Omit<Todo, 'id'>>()
.output<Todo, HttpError>(),
completeById: oc
.route({ method: 'PUT', path: '/todos/{id}' })
.output<Todo, HttpError>(),
}),
});
Thanks!
Hi, I want to use orpc only for clients, but I don't want to add extra bundle to parse the response, is that possible? e.g.
Thanks!