From 9bed96a22f5c755167fae42bbbea05063f254aa7 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 1 Oct 2023 14:42:14 +0530 Subject: [PATCH] Merge branch 'main' of github.com:formbricks/formbricks into how-we-code --- .../app/docs/contributing/how-we-code/page.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/formbricks-com/app/docs/contributing/how-we-code/page.mdx b/apps/formbricks-com/app/docs/contributing/how-we-code/page.mdx index 2bb5a88726..4ea09e78c6 100644 --- a/apps/formbricks-com/app/docs/contributing/how-we-code/page.mdx +++ b/apps/formbricks-com/app/docs/contributing/how-we-code/page.mdx @@ -20,7 +20,7 @@ Thank you for choosing to contribute to Formbricks. Before you start, please fam - Fetch data only in server components - Use Server-Action for mutations - Use service abstraction instead of direct database calls -- Handle authentication and CORS in management API’s +- Handle authentication and CORS in management APIs - Always Document API changes - Constants should be in the packages folder - Types should be in the packages folder @@ -51,18 +51,18 @@ Server actions are used to perform server actions in client components. For exam We utilize [prisma](https://www.prisma.io/) as our Object-Relational Mapping (ORM) tool to interact with the database. This implies that when you need to fetch or modify data in the database, you will be utilizing prisma. All prisma calls should be written in the services folder `packages/lib/services`, and before creating a new service, please ensure that one does not already exist. -## Handle authentication and CORS in management API’s +## Handle authentication and CORS in management APIs -We have two API’s: Management API and Client API. +We have two APIs: Management API and Client API. -The public endpoints of the Client API are used by the link survey and `formbricks-js` to send responses and displays to formbricks. Client API’s can be found in `apps/web/app/api/v1/client` +The public endpoints of the Client API are used by the link survey and `formbricks-js` to send responses and displays to formbricks. Client APIs can be found in `apps/web/app/api/v1/client` -The Management API offers the same functionality as the management frontend and can be used to create surveys, view responses or change account settings. The endpoints require an api key that the user can obtain in the management frontend. Management API’s can be found in `apps/web/app/api/v1/management`. +The Management API offers the same functionality as the management frontend and can be used to create surveys, view responses or change account settings. The endpoints require an api key that the user can obtain in the management frontend. Management APIs can be found in `apps/web/app/api/v1/management`. Please keep the following in mind: -- When dealing with Management API’s always make sure to require authentication via API keys and a sufficient authorization check. -- Make sure to handle CORS request in any new Client API endpoint you create as these are called from the browser in link surveys or `formbricks-js`. Example below: +- When dealing with Management APIs always make sure to require authentication via API keys and a sufficient authorization check. +- Make sure to handle CORS requests in any new Client API endpoint you create as these are called from the browser in link surveys or `formbricks-js`. Example below: