jayb2302 / Drinx

DWP Project for 1 Semester in Web Development
0 stars 0 forks source link

Cocktail Crud #34

Closed jayb2302 closed 3 weeks ago

jayb2302 commented 3 weeks ago

Pull Request Description

This pull request implements full CRUD (Create, Read, Update, Delete) functionality for managing cocktails within the application.

Note: Currently, the difficulty level is not being stored in the database when adding or editing cocktails.

Features Implemented:

  1. Adding Cocktails:

    • Users can create new cocktails by filling out a detailed form, including the title, description, ingredients, preparation steps, category, difficulty level (not stored), and an image.
    • Upon successful submission, cocktails are saved in the database and users are redirected to the cocktail’s view page with a user-friendly URL.
  2. Editing Cocktails:

    • Users can edit their existing cocktails, with the form pre-filled with current data for easy updates.
    • Validation checks ensure all required fields are completed before updates are applied.
    • After editing, users are redirected to the updated cocktail’s view page.
  3. Deleting Cocktails:

    • Users can delete their cocktails with a confirmation prompt to prevent accidental deletions.
    • Only the owner of the cocktail or an admin can delete it.
    • Upon successful deletion, users are redirected to the home page.

Additional Changes: