jon89
jon896mo ago

Can a URL be formatted with dashes, such as "user-list" in the context of trpc?

Can a URL be formatted with dashes, such as "user-list" in the context of trpc?
const appRouter = router({
userList: publicProcedure.query(async () => {
const appRouter = router({
userList: publicProcedure.query(async () => {
I'd prefer not to write router({'user-list'....
3 Replies
Nick
Nick6mo ago
You should be able to do anything that a JS object will allow, though I'm not sure what unhandled corner cases you might be able to find if you abuse it (ie. using . in a procedure name) It's probably best to stick with normal JS conventions
Alex / KATT 🐱
GitHub
feat: Automatic Conversion of tRPC Method Names from CamelCase to K...
Describe the feature you'd like to request This feature request proposes an enhancement to the tRPC framework to automatically convert method names from camelCase (e.g., pathUrl) to kebab-case ...
Alex / KATT 🐱
i don't see the value add of this feature request and I don't think we will want to spend time building and maintaining it if the motivation is only personal preference