> For the complete documentation index, see [llms.txt](https://groceristar.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://groceristar.gitbook.io/documentation/docs/groceristar-website-methods-list/ingredients-router.md).

# README

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Create or find at db new ingredient new ingredient and attach it to grocery list                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | by passing ingredient\_id and grocery\_id                          |
| Method moves ingredient from one department to another(can work only with custom ingredients)                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                    |
| Method that changes the ingredients -> name works only with custom ingredients                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                    |
| Method that delete array of ingredients                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                                                                    |
| Remote method!Create a new custom ingredinet+ save it to db                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | passed user\_id, grocery\_id, department\_id and ingredient `name` |
| Method that will called only if we want to edit not a custom element(we cannot edit main ingredient from our imported database, because this will take affect to other users). So we basically grab grocery\_id, department\_id and create a new ingredient(`custom` ) and attach it to this grocery list and this department. But we also should remove id of previous element - that we changing. Also we can have an order of ingredients, so when we replace ingredient with order 6 - we should apply the same number to a new created ingredient. |                                                                    |
| Method that get list of ingredients from department                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | by passing grocery\_id, department\_id                             |
|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://groceristar.gitbook.io/documentation/docs/groceristar-website-methods-list/ingredients-router.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
