Module: builder_new

Module for the Bouquet Builder. Handles drag-and-drop, graph calculation, and adding the custom bouquet to the cart.

Source:

Methods

(async, inner) fetchComponents()

Fetches the available flower components from the API.

Source:
Throws:

If fetching components fails.

Type
Error

(async, inner) handleCalculateClick()

Calculates the assembly cost of the current bouquet by making a POST request to the API.

Source:
Throws:

If the bouquet has less than two components or the API call fails.

Type
Error

(inner) handleDrop(e)

Handles the drop event, adds the flower to the bouquet, and updates the display.

Parameters:
Name Type Description
e DragEvent

The drag event.

Source: