refactor: Use template literal instead of '+' operator (#11444)

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: zomars <[email protected]>
This commit is contained in:
Aldrin
2023-10-03 11:52:19 -07:00
committed by GitHub
co-authored by Peer Richelsen zomars
parent a186b130cb
commit 3e08c66888
190 changed files with 478 additions and 483 deletions
@@ -6,4 +6,4 @@ items:
- ZCal4.jpg
---
Zoho Calendar is an online business calendar that makes scheduling easy for you. Use this app to sync your Cal bookings with your Zoho Calendar.
Zoho Calendar is an online business calendar that makes scheduling easy for you. Use this app to sync your Cal bookings with your Zoho Calendar.
+16 -16
View File
@@ -1,16 +1,16 @@
## Zoho Calendar
### Obtaining Zoho Calendar Client ID and Secret
1. Open [Zoho API Console](https://api-console.zoho.com/) and sign into your account, or create a new one.
2. Create a "Server-based Applications", set the Redirect URL for OAuth `<Cal.com URL>/api/integrations/zohocalendar/callback` replacing Cal.com URL with the URI at which your application runs.
4. Fill in any information you want in the "Client Details" tab
5. Go to tab "Client Secret" tab.
6. Now copy the Client ID and Client Secret into your app keys in the Cal.com admin panel (`<Cal.com>/settings/admin/apps`).
7. Back in Zoho API Console,
8. In the "Settings" section check the "Multi-DC" option if you wish to use the same OAuth credentials for all data centers.
9. Click the "Save"/ "UPDATE" button at the bottom footer.
10. You're good to go. Now you can easily add your Zoho Calendar integration in the Cal.com settings at `/settings/my-account/calendars`.
11. You can access your Zoho calendar at [https://calendar.zoho.com/](https://calendar.zoho.com/)
NOTE: If you use multiple calendars with Cal, make sure you enable the toggle to prevent double-bookings across calendar. This is in `/settings/my-account/calendars`.
## Zoho Calendar
### Obtaining Zoho Calendar Client ID and Secret
1. Open [Zoho API Console](https://api-console.zoho.com/) and sign into your account, or create a new one.
2. Create a "Server-based Applications", set the Redirect URL for OAuth `<Cal.com URL>/api/integrations/zohocalendar/callback` replacing Cal.com URL with the URI at which your application runs.
3. Fill in any information you want in the "Client Details" tab
4. Go to tab "Client Secret" tab.
5. Now copy the Client ID and Client Secret into your app keys in the Cal.com admin panel (`<Cal.com>/settings/admin/apps`).
6. Back in Zoho API Console,
7. In the "Settings" section check the "Multi-DC" option if you wish to use the same OAuth credentials for all data centers.
8. Click the "Save"/ "UPDATE" button at the bottom footer.
9. You're good to go. Now you can easily add your Zoho Calendar integration in the Cal.com settings at `/settings/my-account/calendars`.
10. You can access your Zoho calendar at [https://calendar.zoho.com/](https://calendar.zoho.com/)
NOTE: If you use multiple calendars with Cal, make sure you enable the toggle to prevent double-bookings across calendar. This is in `/settings/my-account/calendars`.
+1 -1
View File
@@ -20,7 +20,7 @@ async function getHandler(req: NextApiRequest, res: NextApiResponse) {
const params = {
client_id,
response_type: "code",
redirect_uri: WEBAPP_URL + "/api/integrations/zohocalendar/callback",
redirect_uri: `${WEBAPP_URL}/api/integrations/zohocalendar/callback`,
scope: [
"ZohoCalendar.calendar.ALL",
"ZohoCalendar.event.ALL",
@@ -55,7 +55,7 @@ async function getHandler(req: NextApiRequest, res: NextApiResponse) {
if (!response.ok || responseBody.error) {
log.error("get access_token failed", responseBody);
return res.redirect("/apps/installed?error=" + JSON.stringify(responseBody));
return res.redirect(`/apps/installed?error=${JSON.stringify(responseBody)}`);
}
const key: ZohoAuthCredentials = {
@@ -92,7 +92,7 @@ export default class ZohoCalendarService implements Calendar {
method: "GET",
...init,
headers: {
Authorization: "Bearer " + credentials.access_token,
Authorization: `Bearer ${credentials.access_token}`,
"Content-Type": "application/json",
...init?.headers,
},
@@ -105,7 +105,7 @@ export default class ZohoCalendarService implements Calendar {
const response = await fetch(`https://accounts.zoho.com/oauth/user/info`, {
method: "GET",
headers: {
Authorization: "Bearer " + credentials.access_token,
Authorization: `Bearer ${credentials.access_token}`,
"Content-Type": "application/json",
},
});