Я слежу за следующим уроком здесь
Все работает до Вывод списка todo-элементов внутри todos
У меня следующая ошибкаотчет при отправке запроса на сервер:
{"name":"SequelizeDatabaseError","parent":{"name":"error","length":104,"severity":"ERROR","code":"42703","position":"440","file":"parse_relation.c","line":"2743","routine":"errorMissingColumn","sql":"SELECT \"ItemSet\".\"id\", \"ItemSet\".\"title\", \"ItemSet\".\"createdAt\", \"ItemSet\".\"updatedAt\", \"items\".\"id\" AS \"items.id\", \"items\".\"content\" AS \"items.content\", \"items\".\"complete\" AS \"items.complete\", \"items\".\"createdAt\" AS \"items.createdAt\", \"items\".\"updatedAt\" AS \"items.updatedAt\", \"items\".\"itemSetId\" AS \"items.itemSetId\", \"items\".\"itemId\" AS \"items.itemId\" FROM \"ItemSets\" AS \"ItemSet\" LEFT OUTER JOIN \"Items\" AS \"items\" ON \"ItemSet\".\"id\" = \"items\".\"itemId\";"},"original":{"name":"error","length":104,"severity":"ERROR","code":"42703","position":"440","file":"parse_relation.c","line":"2743","routine":"errorMissingColumn","sql":"SELECT \"ItemSet\".\"id\", \"ItemSet\".\"title\", \"ItemSet\".\"createdAt\", \"ItemSet\".\"updatedAt\", \"items\".\"id\" AS \"items.id\", \"items\".\"content\" AS \"items.content\", \"items\".\"complete\" AS \"items.complete\", \"items\".\"createdAt\" AS \"items.createdAt\", \"items\".\"updatedAt\" AS \"items.updatedAt\", \"items\".\"itemSetId\" AS \"items.itemSetId\", \"items\".\"itemId\" AS \"items.itemId\" FROM \"ItemSets\" AS \"ItemSet\" LEFT OUTER JOIN \"Items\" AS \"items\" ON \"ItemSet\".\"id\" = \"items\".\"itemId\";"},"sql":"SELECT \"ItemSet\".\"id\", \"ItemSet\".\"title\", \"ItemSet\".\"createdAt\", \"ItemSet\".\"updatedAt\", \"items\".\"id\" AS \"items.id\", \"items\".\"content\" AS \"items.content\", \"items\".\"complete\" AS \"items.complete\", \"items\".\"createdAt\" AS \"items.createdAt\", \"items\".\"updatedAt\" AS \"items.updatedAt\", \"items\".\"itemSetId\" AS \"items.itemSetId\", \"items\".\"itemId\" AS \"items.itemId\" FROM \"ItemSets\" AS \"ItemSet\" LEFT OUTER JOIN \"Items\" AS \"items\" ON \"ItemSet\".\"id\" = \"items\".\"itemId\";"}
Я внес небольшую модификацию в учебник:
- Я использую
ItemSet
вместо ToDo
- Я использую
Item
вместо ToDoItem
в идеале я хотел бы что-то вернуть, что выглядит так:
мой код доступен здесь: https://github.com/AlexanderMcNulty/seq