feat: giving agent enough information to add to list instead of creating one
This commit is contained in:
@ -162,7 +162,6 @@ const listTools = `
|
||||
}
|
||||
]`
|
||||
|
||||
type listListsArguments struct{}
|
||||
type createListArguments struct {
|
||||
Name string `json:"name"`
|
||||
Desription string `json:"description"`
|
||||
|
@ -86,12 +86,21 @@ func (m ListModel) Save(ctx context.Context, userId uuid.UUID, name string, desc
|
||||
return listWithItems, err
|
||||
}
|
||||
|
||||
func (m ListModel) List(ctx context.Context, userId uuid.UUID) ([]model.Lists, error) {
|
||||
stmt := Lists.SELECT(Lists.AllColumns).
|
||||
func (m ListModel) List(ctx context.Context, userId uuid.UUID) ([]ListWithItems, error) {
|
||||
getListsWithItems := SELECT(
|
||||
Lists.AllColumns,
|
||||
Schemas.AllColumns,
|
||||
SchemaItems.AllColumns,
|
||||
).
|
||||
FROM(
|
||||
Lists.
|
||||
INNER_JOIN(Schemas, Schemas.ListID.EQ(Lists.ID)).
|
||||
INNER_JOIN(SchemaItems, SchemaItems.SchemaID.EQ(Schemas.ID)),
|
||||
).
|
||||
WHERE(Lists.UserID.EQ(UUID(userId)))
|
||||
|
||||
lists := []model.Lists{}
|
||||
err := stmt.QueryContext(ctx, m.dbPool, &lists)
|
||||
lists := []ListWithItems{}
|
||||
err := getListsWithItems.QueryContext(ctx, m.dbPool, &lists)
|
||||
|
||||
return lists, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user