cal.com
cal.com copied to clipboard
help migrate legacy pages/api/ endpoints to tRPC
https://github.com/calcom/cal.com/tree/main/apps/web/pages/api
@zomars wanna make a list of endpoints?
@zomars EDIT:
- [ ]
/api/availability/[user]- [ ] GET -> query
viewer.availability.user
- [ ] GET -> query
- [ ]
/api/availability/calendar- [ ] GET -> query
viewer.selectedCalendars.list - [ ] DELETE -> mutation
viewer.selectedCalendars.delete - [ ] POST -> mutation
viewer.selectedCalendars.createOrUpdateORviewer.availability.calendar.upsert
- [ ] GET -> query
- [ ]
/api/availability/day(DEPRECATED) - [ ]
/api/availability/eventtype- [ ] POST -> mutation
viewer.eventTypes.create - [ ] PATCH -> mutation
viewer.eventTypes.update - [ ] DELETE -> mutation
viewer.eventTypes.delete
- [ ] POST -> mutation
- [ ]
/api/book/confirm- [ ] GET -> query
viewer.book.confirm
- [ ] GET -> query
- [ ]
/api/book/event- [ ] POST -> mutation
viewer.book.event
- [ ] POST -> mutation
- [ ]
/api/book/request-reschedule- [ ] POST -> mutation
viewer.book.requestReschedule
- [ ] POST -> mutation
- [ ]
/api/event-type/index- [ ] GET -> query
viewer.eventTypes.list
- [ ] GET -> query
WIP...
Hi, I would like to pick this issue
Hi, I would like to pick this issue
assigned
Updated issue with initial list. Will add more later
Hi Maintainers, I am working on this endpoint currently.
/api/book/confirmGET ->query viewer.book.confirm
The above should be a POST method in trpc. See below : BookingListItem.tsx
const res = await fetch("/api/book/confirm", {
method: "PATCH",
body: JSON.stringify(body),
headers: {
"Content-Type": "application/json",
},
});
Also for query viewer.book.confirm should it not be viewer.booking.confirm as I can think that is what it is meant for and there already exist a route for that. viewer/bookings.tsx
- The route
/api/event-type/indexroute does not exist.
This is not used anywhere
/api/availability/day (DEPRECATED)
Should I go on and delete this file and it's occurence in calendso.yaml
-
/api/availability/eventtype- POST -> mutation viewer.eventTypes.create
- PATCH -> mutation viewer.eventTypes.update
- DELETE -> mutation viewer.eventTypes.delete
All the 3 methods already exists. link : trpc/server/routers/viewer/eventTypes.tsx Should delete this file and and it's occurence in calendso.yaml
@PeerRich Can you update the original list by checking on what's done and removing what's not required ?
HI @PeerRich , can you update the todos, the below endpoints are completed in previous PR.
- [x] /api/book/confirm
- [x] /api/availability/day
- [x] /api/availability/eventtype // all methods
- [x] /api/event-type
Done!
Hey @zomars, Could help me get through this PR https://github.com/calcom/cal.com/pull/7234 It's WIP and currently blocked by typeScript issue which I am not able to debug it.
closing due to stale. feel free to open a new issue