-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added ability to include ID in url for fetching specific items,…
… editing and deleting records (#38) * chore: update tsconfig.json to include prisma path mapping * chore: update package.json dependencies and bun.lockb file * feat: add Zod generator to Prisma schema * chore: update .gitignore to exclude generated Prisma files * chore: rename api-responses to response-formatter * feat: refactor route management and permissions system * feat: implement API route handler class for improved request management * refactor: remove deprecated schemas file * chore: update docker-compose to use local volume for PostgreSQL data * fix: update health API route to return detailed status response * feat: enhance OpenAPI documentation with structured error responses and CRUD operations for dynamic routes * feat: enhance OpenAPI configuration by adding query parameters for relation inclusion and updating hidden clients list * feat: implement CRUD operations for dynamic routes with dedicated handlers for GET, POST, PUT, and DELETE methods * refactor: simplify OpenAPI configuration by removing unnecessary query parameters and consolidating hidden clients list * feat: extend ApiRouteHandler to support optional ID parameter for CRUD operations * docs: update README to include API documentation link and additional resources * feat: add GET method to dynamic route handler for improved API request management * feat: enhance ApiRouteHandler to support GET requests with optional ID handling and improved error responses * feat: add RouteConfig interface to define route permissions and metadata structure * feat: enhance OpenAPI specification generation with structured error handling and CRUD operations for dynamic routes * fix: removed linting step from build script in package.json * chore: update Prettier configuration to enforce single quotes, trailing commas, and semicolons * chore: update .gitignore to exclude Docker data directory * chore: standardize quotes and update configuration files for consistency * feat: add User route configuration with SENIOR_ONLY permissions * feat: enhance OpenAPI specification to exclude sensitive fields from generated schemas * feat: enhance ApiRouteHandler with type safety for routeConfig and auth,
- Loading branch information
1 parent
e3ff5a6
commit f127791
Showing
21 changed files
with
1,072 additions
and
953 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{ | ||
"plugins": ["prettier-plugin-tailwindcss"] | ||
} | ||
"plugins": ["prettier-plugin-tailwindcss"], | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"semi": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
export default { | ||
extends: ["@commitlint/config-conventional"], | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
"type-enum": [ | ||
'type-enum': [ | ||
2, | ||
"always", | ||
'always', | ||
[ | ||
"ci", | ||
"chore", | ||
"docs", | ||
"ticket", | ||
"feat", | ||
"fix", | ||
"perf", | ||
"refactor", | ||
"revert", | ||
"style", | ||
'ci', | ||
'chore', | ||
'docs', | ||
'ticket', | ||
'feat', | ||
'fix', | ||
'perf', | ||
'refactor', | ||
'revert', | ||
'style', | ||
], | ||
], | ||
"header-max-length": [2, "always", 200], | ||
'header-max-length': [2, 'always', 200], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { NextRequest } from 'next/server'; | ||
|
||
import { ApiRouteHandler } from '@/lib/classes/api-handler'; | ||
|
||
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'; | ||
|
||
export async function GET( | ||
request: NextRequest, | ||
{ params }: { params: Promise<{ route: string; id: string }> }, | ||
) { | ||
const { route, id } = await params; | ||
|
||
const handler = new ApiRouteHandler(request, route, 'GET', id); | ||
return handler.handleRequest(); | ||
} | ||
|
||
export async function PUT( | ||
request: NextRequest, | ||
{ params }: { params: Promise<{ route: string; id: string }> }, | ||
) { | ||
const { route, id } = await params; | ||
|
||
const handler = new ApiRouteHandler(request, route, 'PUT', id); | ||
return handler.handleRequest(); | ||
} | ||
|
||
export async function DELETE( | ||
request: NextRequest, | ||
{ params }: { params: Promise<{ route: string; id: string }> }, | ||
) { | ||
const { route, id } = await params; | ||
|
||
const handler = new ApiRouteHandler(request, route, 'DELETE', id); | ||
return handler.handleRequest(); | ||
} |
Oops, something went wrong.