chore: rename platform endpoints provider/gcal (#14248)

This commit is contained in:
Morgan authored and GitHub committed 2024-03-28 12:04:28 +00:00
1 parent a1840c9362
commit ccc8cdc1ff
8 files changed
+181 -40

No files matched your search

+2 -2
View File
@@ -12,7 +12,7 @@ export const useGcal = ({ isAuth }: useGcalProps) => {
const redirectToGcalOAuth = () => {
http
?.get("/platform/gcal/oauth/auth-url")
?.get("/ee/gcal/oauth/auth-url")
.then(({ data: responseBody }) => {
if (responseBody.data?.authUrl) {
window.location.href = responseBody.data.authUrl;
@@ -24,7 +24,7 @@ export const useGcal = ({ isAuth }: useGcalProps) => {
useEffect(() => {
if (isAuth) {
http
?.get("/platform/gcal/check")
?.get("/ee/gcal/check")
.then(() => setAllowConnect(false))
.catch(() => setAllowConnect(true))
.finally(() => setChecked(true));
@@ -30,7 +30,7 @@ export const useOAuthClient = ({ clientId, apiUrl, refreshUrl, onError, onSucces
useEffect(() => {
if (clientId && http.getUrl() && prevClientId !== clientId) {
try {
http.get<ApiResponse>(`/platform/provider/${clientId}`).catch((err: AxiosError) => {
http.get<ApiResponse>(`/ee/provider/${clientId}`).catch((err: AxiosError) => {
if (err.response?.status === 401) {
onError("Invalid oAuth Client.");
} else {
@@ -58,7 +58,7 @@ export const useOAuthFlow = ({ accessToken, refreshUrl, clientId, onError, onSuc
http.setAuthorizationHeader(accessToken);
try {
http
.get<ApiResponse>(`/platform/provider/${clientId}/access-token`)
.get<ApiResponse>(`/ee/provider/${clientId}/access-token`)
.catch(async (err: AxiosError) => {
if ((err.response?.status === 498 || err.response?.status === 401) && refreshUrl) {
setIsRefreshing(true);
+1 -1
View File
@@ -29,7 +29,7 @@ REDIS_URL="redis://localhost:6379"
2. Open ".env" file and paste client id from step 8 in `NEXT_PUBLIC_X_CAL_ID` and client secret in `X_CAL_SECRET_KEY`. If in step 2 you used the same environment variables, then `NEXT_PUBLIC_CALCOM_API_URL` can stay as is. Otherwise adjust the port to point to the same `API_PORT` as you used in step 2.
10. Navigate to example app and setup database by running `rm -f prisma/dev.db && yarn prisma db push`.
11. Start the example app by running `yarn dev` and go to `http://localhost:4321`.
12. In the Google Cloud Console "API & Services" "Credentials" `https://console.cloud.google.com/apis/credentials` open web project setup in step 1 and add `http://localhost:5555/api/v2/platform/gcal/oauth/save` to the authorized redirect URIs.
12. In the Google Cloud Console "API & Services" "Credentials" `https://console.cloud.google.com/apis/credentials` open web project setup in step 1 and add `http://localhost:5555/api/v2/ee/gcal/oauth/save` to the authorized redirect URIs.
<img width="1000" alt="Screenshot 2024-03-21 at 09 42 36" src="https://github.com/calcom/atoms-examples/assets/42170848/82ce4d7a-fc08-489a-ab06-a8eb41a68a2a">