Skip to content

Scheduling infrastructure for absolutely everyone.

Linting

zomarsd8b9bbc45274
diff --git a/README.md b/README.md
index d210672e53a..8c39f8457fe 100644
--- a/README.md
+++ b/README.md
@@ -120,21 +120,21 @@ We aim to provide a fully tested API for our peace of mind, this is accomplished
## Endpoints matrix
-| resource | get [id] | get all | create | edit | delete |
-| ------------------------ | -------- | ------- | ------ | ---- | ------ |
-| attendees | ✅ | ✅ | ✅ | ✅ | ✅ |
-| availabilities | ✅ | ✅ | ✅ | ✅ | ✅ |
-| booking-references | ✅ | ✅ | ✅ | ✅ | ✅ |
-| event-references | ✅ | ✅ | ✅ | ✅ | ✅ |
-| destination-calendars | ✅ | ✅ | ✅ | ✅ | ✅ |
-| custom-inputs | ✅ | ✅ | ✅ | ✅ | ✅ |
-| event-types | ✅ | ✅ | ✅ | ✅ | ✅ |
-| memberships | ✅ | ✅ | ✅ | ✅ | ✅ |
-| payments | ✅ | ✅ | ❌ | ❌ | ❌ |
-| schedules | ✅ | ✅ | ✅ | ✅ | ✅ |
-| selected-calendars | ✅ | ✅ | ✅ | ✅ | ✅ |
-| teams | ✅ | ✅ | ✅ | ✅ | ✅ |
-| users | ✅ | 👤[1] | ✅ | ✅ | ✅ |
+| resource | get [id] | get all | create | edit | delete |
+| --------------------- | -------- | ------- | ------ | ---- | ------ |
+| attendees | ✅ | ✅ | ✅ | ✅ | ✅ |
+| availabilities | ✅ | ✅ | ✅ | ✅ | ✅ |
+| booking-references | ✅ | ✅ | ✅ | ✅ | ✅ |
+| event-references | ✅ | ✅ | ✅ | ✅ | ✅ |
+| destination-calendars | ✅ | ✅ | ✅ | ✅ | ✅ |
+| custom-inputs | ✅ | ✅ | ✅ | ✅ | ✅ |
+| event-types | ✅ | ✅ | ✅ | ✅ | ✅ |
+| memberships | ✅ | ✅ | ✅ | ✅ | ✅ |
+| payments | ✅ | ✅ | ❌ | ❌ | ❌ |
+| schedules | ✅ | ✅ | ✅ | ✅ | ✅ |
+| selected-calendars | ✅ | ✅ | ✅ | ✅ | ✅ |
+| teams | ✅ | ✅ | ✅ | ✅ | ✅ |
+| users | ✅ | 👤[1] | ✅ | ✅ | ✅ |
## Models from database that are not exposed
diff --git a/package.json b/package.json
index 14c34d18af4..555cc3efaf8 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"private": true,
"scripts": {
"dev": "next build && PORT=3002 next start",
- "dev-real":"PORT=3002 next dev",
+ "dev-real": "PORT=3002 next dev",
"start": "PORT=3002 next start",
"build": "next build",
"lint": "next lint",
diff --git a/templates/README.md b/templates/README.md
index 588797c42a3..3a171b93189 100644
--- a/templates/README.md
+++ b/templates/README.md
@@ -11,10 +11,11 @@ Basically there's three places of the codebase you need to think about for each
## The example resource -model- and it's endpoints
### `pages/api/endpoint/`
-| Method | route | action |
-| ------ | ----- | ----- |
-| GET | pages/api/endpoint/index.ts | Read All of your resource |
-| POST |pages/api/endpoint/new.ts | Create new resource |
+
+| Method | route | action |
+| ------ | --------------------------- | ------------------------- |
+| GET | pages/api/endpoint/index.ts | Read All of your resource |
+| POST | pages/api/endpoint/new.ts | Create new resource |
### `pages/api/endpoint/[id]/`
diff --git a/templates/endpoints/[id]/delete.ts b/templates/endpoints/[id]/delete.ts
index 79645cbdfde..39e026f4189 100644
--- a/templates/endpoints/[id]/delete.ts
+++ b/templates/endpoints/[id]/delete.ts
@@ -32,7 +32,7 @@ import {
* 401:
* description: Authorization information is missing or invalid.
*/
-export async function deleteResource({query}: NextApiRequest, res: NextApiResponse<BaseResponse>) {
+export async function deleteResource({ query }: NextApiRequest, res: NextApiResponse<BaseResponse>) {
const safe = schemaQueryIdParseInt.safeParse(query);
if (!safe.success) throw new Error("Invalid request query");
diff --git a/templates/endpoints/[id]/edit.ts b/templates/endpoints/[id]/edit.ts
index 8346840ec38..cb4b1f05c5b 100644
--- a/templates/endpoints/[id]/edit.ts
+++ b/templates/endpoints/[id]/edit.ts
@@ -33,7 +33,7 @@ import {
* 401:
* description: Authorization information is missing or invalid.
*/
-export async function editResource({query, body}: NextApiRequest, res: NextApiResponse<ResourceResponse>) {
+export async function editResource({ query, body }: NextApiRequest, res: NextApiResponse<ResourceResponse>) {
const safeQuery = schemaQueryIdParseInt.safeParse(query);
const safeBody = schemaResourceBodyParams.safeParse(body);
diff --git a/templates/endpoints/[id]/index.ts b/templates/endpoints/[id]/index.ts
index 7933c5cab14..da3a2fd2dd2 100644
--- a/templates/endpoints/[id]/index.ts
+++ b/templates/endpoints/[id]/index.ts
@@ -33,7 +33,7 @@ import {
* 404:
* description: Resource was not found
*/
-export async function resourceById({query}: NextApiRequest, res: NextApiResponse<ResourceResponse>) {
+export async function resourceById({ query }: NextApiRequest, res: NextApiResponse<ResourceResponse>) {
const safe = schemaQueryIdParseInt.safeParse(query);
if (!safe.success) throw new Error("Invalid request query");
diff --git a/templates/endpoints/get_all_and_post.ts b/templates/endpoints/get_all_and_post.ts
index e21dc8bb9dd..ba35a7525be 100644
--- a/templates/endpoints/get_all_and_post.ts
+++ b/templates/endpoints/get_all_and_post.ts
@@ -7,12 +7,11 @@ import { PaymentResponse, PaymentsResponse } from "@lib/types";
import { schemaPaymentBodyParams, schemaPaymentPublic } from "@lib/validations/payment";
async function createOrlistAllPayments(
- {method, body}: NextApiRequest,
+ { method, body }: NextApiRequest,
res: NextApiResponse<PaymentsResponse | PaymentResponse>
) {
if (method === "GET") {
-
-/**
+ /**
* @swagger
* /v1/payments:
* get:
@@ -38,8 +37,7 @@ async function createOrlistAllPayments(
error,
});
} else if (method === "POST") {
-
-/**
+ /**
* @swagger
* /v1/payments:
* post:
diff --git a/templates/endpoints/post.ts b/templates/endpoints/post.ts
index 896c09e6918..61cff72a15e 100644
--- a/templates/endpoints/post.ts
+++ b/templates/endpoints/post.ts
@@ -29,7 +29,7 @@ import { schemaResourceBodyParams, schemaResourcePublic, withValidResource } fro
* 401:
* description: Authorization information is missing or invalid.
*/
-async function createResource({body}: NextApiRequest, res: NextApiResponse<ResourceResponse>) {
+async function createResource({ body }: NextApiRequest, res: NextApiResponse<ResourceResponse>) {
const safe = schemaResourceBodyParams.safeParse(body);
if (!safe.success) throw new Error("Invalid request body");
diff --git a/types.d.ts b/types.d.ts
index 2abf07e4c1e..9a7af651d13 100644
--- a/types.d.ts
+++ b/types.d.ts
@@ -1,2 +1 @@
declare module "modify-response-middleware";
-