mirror of
https://github.com/sassanix/Warracker.git
synced 2026-01-02 11:39:58 -06:00
Fixed API Connection Issue Changed the Nginx proxy configuration from proxy_pass http://localhost:5000; to proxy_pass http://127.0.0.1:5000; in the container's configuration This resolved the "ERR_CONNECTION_REFUSED" error by ensuring proper communication between Nginx and the Flask backend within the Docker container Fixed Database Serialization Error Updated the Python imports in app.py to properly include the date class: from datetime import datetime, timedelta, date Modified the type checking code to correctly identify date objects: isinstance(value, (datetime, date)) This resolved the "isinstance() arg 2 must be a type or tuple of types" error that was preventing the application from retrieving warranty data These changes resolved the connection issues between frontend and backend components, allowing the application to successfully add and display warranty information.
14 lines
411 B
SQL
14 lines
411 B
SQL
-- backend/init.sql
|
|
|
|
CREATE TABLE warranties (
|
|
id SERIAL PRIMARY KEY,
|
|
product_name VARCHAR(255) NOT NULL,
|
|
purchase_date DATE NOT NULL,
|
|
warranty_years INTEGER NOT NULL,
|
|
expiration_date DATE,
|
|
invoice_path TEXT,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
CREATE INDEX idx_expiration_date ON warranties(expiration_date);
|
|
CREATE INDEX idx_product_name ON warranties(product_name); |