Dia-Dev-Design / Dia-Dev-Design/shearly-next

Create Basic CRUD Routes for Provider

Open
#38 0 comments 0 reactions 1 assignee Claimed by @LuisOrtiz79 View on GitHub
enhancement
Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Create routes for Provider that allow for the following:

1. Create:
- Location → "shearly-next/app/api/provider/create/route.ts".
- Method → POST
- Goal → Given a body with name, email, phone and password do the following:
1. Verify that a Provider with said email doesn't exist.
2. Encrypt the password using bcrypt.
3. Finally create the Provider.

2. Find:
- Find All:
- Location → "shearly-next/app/api/provider/find/route.ts".
- Method → GET
- Goal → Must be able to get all Providers from database.
- Find By Id:
- Location → "shearly-next/app/api/provider/find/[id]/route.ts".
- Method → GET
- Goal → Must be able to get a single Provider by ID.

3. Edit:
- Location → "shearly-next/app/api/provider/edit/[id]/route.ts"
- Method → PUT
- Goal → Must allow to edit any property of a Provider so long as name, email, phone and password are not null, if email is changed it must not exist in the database and password must be encrypted.

4. Delete:
- Location → "shearly-next/app/api/provider/delete/[id]/route.ts"
- Method → DELETE
- Goal → Must be able to delete a Provider given an id.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.