techcsispit / MERN-Auth-Workouts-App

This Workouts App is a full-stack CRUD application built using the MERN stack (MongoDB, Express, React, Node.js) with authentication implemented using Bcrypt and JWT. The app allows users to create, update, view, and delete workouts once they are authenticated. Contributions are welcome to improve styling, fix bugs, and add features.
0 stars 2 forks source link

Created frontend for creating and deleting workout templates. #11

Closed Dash10107 closed 1 week ago

Dash10107 commented 1 week ago

Closes Issue #8

This PR addresses the issue related to adding frontend functionality to manage workout templates. The following features have been implemented:

Key Changes:

Create New Template: Integrated a form for creating new workout templates. Connected the form submission to the backend API to save templates. On successful submission, the new template is added to the list of templates displayed on the page.

View & Delete Available Templates:

Added functionality to fetch and display existing workout templates in a list format. Added the ability to delete workout templates by clicking the delete button. This action removes the template from both the frontend list and the backend database.

Code Summary: The main logic has been added in the Template component. Fetching, saving, editing, and deleting templates is handled via API calls with authentication using Bearer tokens. User authentication context (useAuthContext) is integrated to ensure only authenticated users can manage templates.

How to Test: Log in with an authenticated user account. Navigate to the "Templates" page.

WhatsApp Image 2024-10-16 at 19 57 17_38068c5a

Test the following: Create a new template: Fill out the form and submit. View templates : Click on the template and check out which excercise it consists of. Delete a template: Click the delete button and verify the template is removed.