Commit Graph

336 Commits (d47fa578b756f04c57e5bb1bf044806e2f3c17e2)

Author SHA1 Message Date
Omar López da61841525
Refactors booking references endpoints (#180)
refs #175
2022-10-11 15:25:57 +01:00
zomars 88332fb2ab Refactors teams 2022-10-10 20:25:47 -06:00
zomars c03144c343 Fixed major flaw with authMiddleware
authMiddleware should not use defaultResponder directly as it will catch thrown error and we need those errors to prevent running the rest of the code.
2022-10-10 20:23:08 -06:00
zomars a35454bb68 Me cleanup 2022-10-10 18:02:36 -06:00
Omar López 18e96e2a47
Refactors availabilities endpoints (#177)
refs #175
2022-10-10 09:42:15 -06:00
zomars d4a2b8e791 Refactors attendees' endpoints 2022-10-07 13:08:25 -06:00
Omar López 85890a6acb
Merge pull request #172 from calcom/fix/invalid-eventtypeid
Recurring event booking: invalid eventTypeId
2022-10-07 10:59:14 -06:00
Syed Ali Shahbaz f5d953ef1c
Hotfix/schedule (#174)
* Allows empty call

An authorized API call by a non-admin user with empty body will still fetch his data now

* Adds missing return
2022-10-07 15:33:04 +05:30
Joe Au-Yeung d68ce5e72f
Admin privileges for /availabilities endpoint (#169)
* List other user's availabilities

* /availabilityId methods for other users

* Add return statements

* Accept userId single value or array

* Add zod schema checks

* Filter for schedules only with an availability

* Adds safeParsing of JSON before safeParsing of zod

* Removed console log

* Adds safe JSON parsing before .safeParse

* Allow API call without necessarily passing userId

Allow `/availabilities` call by a regular user without having to pass their userId to make it work

Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>
2022-10-07 15:26:02 +05:30
Syed Ali Shahbaz 0abf286785
Merge pull request #168 from calcom/create-schedule-with-availability
Admin privileges for /schedules
2022-10-07 10:23:41 +02:00
Syed Ali Shahbaz 628306793d
Prettier fix :/ 2022-10-07 13:47:46 +05:30
Syed Ali Shahbaz b05b6e48e7
Fixes another typo 2022-10-07 13:41:17 +05:30
Syed Ali Shahbaz 8eaad0c1c6
fixed typo 2022-10-07 13:34:02 +05:30
Syed Ali Shahbaz 9a65c547dc
Adds missing return after res 2022-10-07 13:24:55 +05:30
Syed Ali Shahbaz 21e081c64c
Adds meaningful response for API caller 2022-10-07 13:15:35 +05:30
Syed Ali Shahbaz affba8bf66
Adds meaningful response for API caller 2022-10-07 13:13:56 +05:30
Syed Ali Shahbaz 79fabe0333
Adds safeParseJSON to the body 2022-10-07 13:03:09 +05:30
Syed Ali Shahbaz 36a0ebfbad
Adds safe json parse of the body
It ensures that the body complies with the safe parsing of the JSON so that if the body sent is not a valid JSON, we convert it into an empty JSON. Would improve in handling the response of such cases as a follow up for improved UX
2022-10-07 12:46:35 +05:30
Leo Giovanetti 70b9969fe3 Fixing en error case for invalid eventTypeId 2022-10-06 18:27:49 -03:00
Leo Giovanetti 2a05f15156
Recurring booking implementation (#167)
* Recurring booking implementation

* Tweaks to expected texts in tests

* Applied feedback

Co-authored-by: zomars <zomars@me.com>
2022-10-06 17:40:41 -03:00
Joe Au-Yeung da88beb1f5 Fix type errors 2022-10-06 15:06:07 -04:00
Joe Au-Yeung 00ccb4ffd1 Simplify get /schedules 2022-10-06 14:41:50 -04:00
Joe Au-Yeung 2a7a111855 Safe parse for userId 2022-10-06 14:38:17 -04:00
Joe Au-Yeung 48f270d032 Remove console log 2022-10-06 10:59:46 -04:00
Joe Au-Yeung 34f5f5f83f Pass userId as single value or array 2022-10-06 10:55:14 -04:00
Joe Au-Yeung 4ac9c1e6dd Remove old comment 2022-10-06 10:02:35 -04:00
Joe Au-Yeung 372e188228 Pass userId as a single value or an array 2022-10-06 09:55:34 -04:00
Joe Au-Yeung 77b89fda05 Add return statements 2022-10-05 16:02:34 -04:00
Joe Au-Yeung ce8af8b6a5 Allow for admin to edit other user's event types 2022-10-05 15:59:34 -04:00
Joe Au-Yeung a5413b40ab Add ability to get, post, and delete for other users if admin 2022-10-05 11:04:58 -04:00
Joe Au-Yeung 95fc04a453 Add check for userId and admin to top 2022-10-05 10:05:04 -04:00
Joe Au-Yeung 1adace1c0d Create new availability on new schedule 2022-10-05 09:56:27 -04:00
Joe Au-Yeung 362d8ca769 Connect user to new event type 2022-10-03 14:26:00 -04:00
Peer Richelsen d14c8404e7
Update index.ts 2022-09-24 13:23:10 +00:00
Agusti Fernandez Pardo fc4d0ab3ea fix: prisma not defined 2022-09-06 19:40:23 +02:00
Agusti Fernandez Pardo 80bd5068d4 fix: don't use defaultHandler w promise in api yet, was from console 2022-09-06 19:20:04 +02:00
Agusti Fernandez Pardo 3caee6c697 fix: removes daily-event-reference endpoints and types 2022-09-06 19:04:16 +02:00
Agusti Fernandez Pardo 731288bcb6 fix: use middleware, refactor into _get 2022-09-05 21:31:12 +02:00
Agusti Fernandez Pardo 4d74a6c896 feat: dont use ensureSession, but userId from req 2022-09-05 21:16:45 +02:00
Agusti Fernandez Pardo bc8623edb8 feat: adds me endpoint that returns session info 2022-09-05 21:01:55 +02:00
Agusti Fernandez Pardo 2bb6c7de45
Merge pull request #135 from calcom/feat/availability-teams
Feat/availability teams + pagination for /users
2022-07-12 20:16:57 +02:00
Agusti Fernandez Pardo 67fe26ec69 fix: lint issue import order 2022-07-12 20:09:54 +02:00
Agusti Fernandez Pardo f87eb7d18e fix: lint add spaces 2022-07-12 20:01:51 +02:00
Agusti Fernandez Pardo f985bbd1ff fix: move patch to no then/catch 2022-07-12 20:01:25 +02:00
Agusti Fernandez Pardo 3f6e7904cb fix: no http_method middleware needed as already handled by defaultHandler 2022-07-08 21:49:14 +02:00
Agusti Fernandez Pardo 76d0b0c1ee
Update pages/api/users/_get.ts
remove console log statement

Co-authored-by: Omar López <zomars@me.com>
2022-07-08 19:34:26 +02:00
Agusti Fernandez Pardo 80e414d4f5
Update pages/api/availability/_get.ts
no if just return

Co-authored-by: Omar López <zomars@me.com>
2022-07-08 19:33:50 +02:00
Agusti Fernandez Pardo a72fbfa093
Update pages/api/availability/_get.ts
improve error message team no members

Co-authored-by: Omar López <zomars@me.com>
2022-07-08 19:33:37 +02:00
Agusti Fernandez Pardo f6faa8bc46
Update pages/api/users/_get.ts
remove console log

Co-authored-by: Omar López <zomars@me.com>
2022-07-08 19:33:17 +02:00
Agusti Fernandez Pardo bd485b7b77
Update pages/api/teams/_get.ts
fix prisma import

Co-authored-by: Omar López <zomars@me.com>
2022-07-08 19:33:00 +02:00
zomars 308c192912 Splits booking/[id] endpoint
# Conflicts:
#	pages/api/bookings/[id].ts
2022-07-08 11:22:08 -06:00
Agusti Fernandez Pardo 6b09fb24ab fix: adds returns, no breaks 2022-07-08 17:23:06 +02:00
Agusti Fernandez Pardo 44ce77f814 fix: test return booking get 2022-07-06 01:17:59 +02:00
Agusti Fernandez Pardo a6e199be67 fix: make availability for teamId work 2022-07-05 23:05:29 +02:00
Agusti Fernandez Pardo f1ee03f297 fix: add teams memberships users 2022-07-05 20:58:26 +02:00
Agusti Fernandez Pardo 2263e04217
Update pages/api/availability/_get.ts
add select: availabilitUserSelect

Co-authored-by: Omar López <zomars@me.com>
2022-07-05 20:35:30 +02:00
Agusti Fernandez Pardo 5dbb2066e0
Update pages/api/availability/_get.ts
add initialData: {user}

Co-authored-by: Omar López <zomars@me.com>
2022-07-05 20:34:53 +02:00
Agusti Fernandez Pardo a63b623a7d feat: teamId availability in API 2022-07-05 20:12:14 +02:00
Agusti Fernandez Pardo be2647790c feat: refactor teams and add team availability 2022-06-30 00:01:14 +02:00
Agusti Fernandez Pardo 561271f3f6 fix: isAdmin from req, no isAdminGuard everywhere 2022-06-24 00:53:15 +02:00
Agusti Fernandez Pardo 61c82eb197 fix: address issues raised in preview PR 2022-06-24 00:26:40 +02:00
Agusti Fernandez Pardo 04b9b71310 fix: userId not, id remove templates stall 2022-06-24 00:09:23 +02:00
Agusti Fernandez Pardo 60688e2e91 fix: make isAdmin require req.prisma too 2022-06-18 03:03:13 +02:00
Agusti Fernandez Pardo 5b28e9ec1c fix: main merging issues 2022-06-18 02:16:15 +02:00
Agusti Fernandez Pardo 6e68671c2a fix: merge w main 2022-06-18 01:52:37 +02:00
Agusti Fernandez Pardo 29be8f5266 fix: makes id optional in availability 2022-06-16 21:50:41 +02:00
Agusti Fernandez Pardo 8b87cde733 fix: _delete missing userId rename 2022-06-16 01:48:29 +02:00
Agusti Fernandez Pardo 11f3d411b3 fix: rename users id to users userId to easier availability sharing _get endpoint 2022-06-16 00:18:40 +02:00
Agusti Fernandez Pardo 4389288e69 feat: adds users/id/availability endpoint 2022-06-16 00:04:04 +02:00
Agusti Fernandez Pardo 26f861d0d0
Merge pull request #107 from calcom/feat/admin-events
Feat: Add admin enpoints for event-types, bookings, attendees
2022-06-15 21:58:31 +02:00
Agusti Fernandez Pardo 26b9e94568 fix: undo changes in users 2022-06-15 21:16:46 +02:00
Agusti Fernandez Pardo 8c3774e100 fix: remove comment 2022-06-15 21:14:35 +02:00
Agusti Fernandez Pardo 1d2e5f07ef feat: admin endpoints for bookings 2022-06-15 21:10:19 +02:00
Agusti Fernandez Pardo ed1bc8015a feat: initial isAdmin work for events and attendees 2022-06-15 20:43:35 +02:00
Agusti Fernandez Pardo 996ec31b26 Merge branch 'main' into feat/admin-events 2022-06-15 20:11:30 +02:00
Agusti Fernandez Pardo 1bde5d88c1 fix: add back optional 2022-06-14 23:43:53 +02:00
Agusti Fernandez Pardo 372b20a4c9 fix: no post for now 2022-06-14 23:42:51 +02:00
Agusti Fernandez Pardo ba37ae78d9 fix: adds middleware, makes userId not optional 2022-06-14 23:41:33 +02:00
zomars e1bcd38e61 Adds basic availability endpoint 2022-06-14 15:17:09 -06:00
zomars 1ab81fb8ee Better error on user delete 2022-06-14 14:51:23 -06:00
zomars 0f72a9084a Splits user endpoints by method 2022-06-14 14:35:15 -06:00
zomars 7d0cef065f Refactors user id endpoint 2022-06-14 14:10:59 -06:00
zomars 58e1ea9bf6 User endpoint refactoring 2022-06-14 14:08:58 -06:00
Syed Ali Shahbaz b385d3547b
Adds debug console.log 2022-06-13 13:24:21 +05:30
Syed Ali Shahbaz ecce02ebbf debug logs added 2022-06-12 11:43:26 +05:30
Syed Ali Shahbaz 935473cfcd removed comment 2022-06-12 11:25:53 +05:30
Syed Ali Shahbaz bd88bec1d2 fix prettier 2022-06-12 11:24:38 +05:30
Syed Ali Shahbaz 470c43befe call webhook before sending booking response 2022-06-12 11:16:16 +05:30
Syed Ali Shahbaz 910a0f386a
Debug booking API 2022-06-11 22:39:03 +05:30
Syed Ali Shahbaz 719e21497b removed invalid response 2022-06-11 17:03:11 +05:30
Syed Ali Shahbaz 3c98c5cefc fixing id to uid in create body 2022-06-11 16:58:21 +05:30
Syed Ali Shahbaz 61e742ed5e uuid automate in booking API 2022-06-11 16:57:35 +05:30
Syed Ali Shahbaz 110edd7dcc removed 18next rel 2022-06-11 16:54:30 +05:30
Syed Ali Shahbaz 99e58c414c prettier fix -3 2022-06-10 16:36:28 +05:30
Syed Ali Shahbaz 301c132815 prettier fix attempt-2 2022-06-10 16:21:55 +05:30
Syed Ali Shahbaz 5453af6d6e prettier fix attempt 2022-06-10 15:57:31 +05:30
Syed Ali Shahbaz 8339d339a1 prettier and payload fix 2022-06-10 13:38:45 +05:30
Syed Ali Shahbaz f1c98181d2 tfunction added 2022-06-10 13:30:43 +05:30
Syed Ali Shahbaz ef5bbfe4f9 fixed timeZone key 2022-06-10 13:22:06 +05:30
Syed Ali Shahbaz a8ad052a03 --convert date to string in calendar event 2022-06-10 13:16:58 +05:30