Commit graph

150 commits

Author SHA1 Message Date
04457fef62 build(cargo.toml): remove unused dependencies 2025-03-05 19:15:08 +03:00
db29d1e05a test(db): test for selected properties addition, retrieval and duplicate prevention. 2025-03-05 16:50:26 +03:00
c96dacaaeb test(db): add url management test and use INSERT or IGNORE to handle url duplicates 2025-03-04 23:49:05 +03:00
aa9743fd2b test(db): test existence of selected properties table 2025-03-04 23:25:29 +03:00
88c6acd7e4 test(db): add test for property management. 2025-03-04 23:17:55 +03:00
505647b432 test(db): implement database layer tests.
-set up test structure
-implement item lifetime tests
2025-03-04 18:05:18 +03:00
1b99027dbf build(test): add testing dependencies to Cargo.toml 2025-03-03 16:18:07 +03:00
d77a806fe7 docs(db): document Database schema in README.md 2025-02-27 16:27:16 +03:00
5a14111db7 fix(properties): correct property saving and fetching 2025-02-26 02:18:32 +03:00
7e288b3a82 fix(url): fix url routing 2025-02-25 19:59:52 +03:00
f51d40a4d0 docs(nostr): comment out nostr integration in app.rs 2025-02-25 17:08:39 +03:00
a47d6b2e3a fix(db): fix property and item deletion 2025-02-25 16:47:58 +03:00
0a05b41ffa fix(db): improve property handling 2025-02-25 15:07:28 +03:00
197e7be2a8 feat(db): replace item insertion with upsert operation. 2025-02-25 02:18:19 +03:00
2e0b038e2a fix(db): add transaction handling and logging for database operations. 2025-02-25 01:38:32 +03:00
b9f3214a38 fix(url): remove manual url decoding 2025-02-24 19:49:20 +03:00
bca34d1ebc fix(api): enhance the error handling in api get_items endpoint 2025-02-24 17:46:21 +03:00
c9b24faad7 fix(404 error): enhance the logging in the item loading process to diagnose the 404 error 2025-02-24 17:42:07 +03:00
03ffeb10fc fix(url): fix URL encoding mismatch 2025-02-24 15:28:47 +03:00
b3ac709526 fix(missing url): handle missing URLs gracefully 2025-02-24 10:46:13 +03:00
de14061b9a fix(item saving): fix Item Saving Error (400 Bad Request) 2025-02-24 10:27:40 +03:00
fd39e3b967 feat(url): update api calls in items_list.rs 2025-02-22 02:27:34 +03:00
ad9942a44f feat(routes): edit API routes to use URL parameter 2025-02-21 16:43:45 +03:00
585a4a6eb7 fix(debug): add logging to solve db saving issues 2025-02-21 15:11:11 +03:00
e90a6be010 feat (items_list.rs): simplify deserialization and remove unnecessary conversions 2025-02-20 16:26:43 +03:00
63aaa57fa1 refactor(imports): remove unused imports 2025-02-20 15:57:02 +03:00
a35d4d557d feat(ssr): added get_current_url function for SSR support 2025-02-20 15:38:43 +03:00
2bcdea79dc fead(db): initialize database first 2025-02-20 15:36:33 +03:00
a379e93f44 feat(db): add proper error handling to schema table creation 2025-02-20 15:01:29 +03:00
a8d8e9a131 feat(db): migrate to relational property storage
-Removed JSON (de)serialization from DbItem struct
-Added direct Item struct handling in database operations
-remove insert_item function
2025-02-19 22:45:24 +03:00
af1e6d949f feat(item_list): remove JSON deserialization of custom properties in items loader 2025-02-19 22:11:13 +03:00
5815c9fe10 feat(item_list): make DbItem struct public. 2025-02-18 23:44:45 +03:00
8e3c87f315 feat(main): edit main function and API handlers
* Removed redundant imports and unused variables
* Simplified `create_item_handler` to use `ItemRequest` struct
* Removed unnecessary cloning of database Arc
* Improved code organization and readability
2025-02-18 23:43:38 +03:00
b6b1ebde9c refactor(api): simplify API handlers and request bodies
* Introduced `ItemRequest` struct to encapsulate URL and item data
* Updated `create_item` handler to accept `ItemRequest` instead of separate URL and item parameters
* Removed redundant error handling and logging in API handlers
* Improved code organization and readability
2025-02-18 23:41:18 +03:00
74bd1a89e5 feat(db): edit database schema and item insertion logic
* Added a junction table for custom properties to improve data normalization
* Modified the `insert_item_by_url` function to handle custom properties through the junction table
* Introduced `get_url_id` and `get_or_create_property` helper functions for improved code organization
* Updated the `insert_item_by_url` function to use the new helper functions and handle custom properties correctly
* Improved error handling and logging throughout the database module
2025-02-18 23:38:45 +03:00
9beb997125 feat(item_list): update save_item_to_db function to take current_url as an argument.
Changes:

* Replaced `let current_url = get_current_url();` with `let current_url = Rc::new(get_current_url());` to share the current URL between closures.
* Wrapped `add_property` and `update_item` functions in Arc to share them between closures.
* Updated `save_item_to_db` function to take `current_url` as an argument and use it to construct the ItemToSend struct.
* Updated `fetch_property_labels` function to use the `property_ids` vector instead of a single property ID.
* Updated `fetch_item_properties` function to use the `wikidata_id` parameter instead of a hardcoded value.
* Updated `WikidataResponse` struct to use a `Vec<WikidataSuggestion>` instead of a single `WikidataSuggestion`.
2025-02-18 20:01:45 +03:00
63f11f6a2d feat(db): move function to lead items from db outside the items list component. 2025-02-17 20:19:54 +03:00
eba20abf5a feat(app): add router and dynamic item loading to app component 2025-02-17 17:04:43 +03:00
ecc991cc24 feat(db): add properties table and junction table for custom properties 2025-02-17 17:04:16 +03:00
8860ace51f feat(url): Added API handlers for item management by URL 2025-02-14 17:50:58 +03:00
7939c9e7b6 feat(url): add server-side rendering feature with URL routing 2025-02-13 23:07:27 +03:00
fddec7f728 feat(url): edit items list component to include current URL in database query 2025-02-13 23:06:26 +03:00
1a5c245250 feat(api): add URL parameter support to API endpoints 2025-02-12 16:12:33 +03:00
e72ed778a2 feat(item): remove reviews from item struct. 2025-02-12 15:56:11 +03:00
bfded464c9 feat(db): update db.rs to save url specific items and properties 2025-02-12 15:55:17 +03:00
ce1e93fc49 feat(db): create new URL table and update the existing table to include a foreign key to the URLs table 2025-02-11 23:36:43 +03:00
443c7a7e0c build(files): remove unused item_form.rs and wikidata_lookup.rs files 2025-02-06 22:19:42 +03:00
4bfd47d8c4 feat(item_list): normalize property labels to display the right labels on the item list 2025-02-04 14:29:11 +03:00
94ed4c46b9 feat(item_list): succesfully fetch property labels using SPARQL 2025-02-03 19:48:50 +03:00
25b3128181 feat(item_list): use sparql to fetch properties 2025-02-03 14:58:56 +03:00