Remove brand functionality and update Bambu Lab colors

- Remove brand field from entire codebase (frontend, backend, database)
- Update Bambu Lab colors to official list with correct hex values
- Clean up unused code and type definitions
- Add database migration to drop brand column
- Update search and filters to exclude brand references
- Ensure data persistence across all application layers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: DaX <noreply@anthropic.com>
This commit is contained in:
DaX
2025-06-23 22:54:47 +02:00
parent 808ca077fa
commit e8f9a6c6e3
10 changed files with 199 additions and 105 deletions

View File

@@ -132,13 +132,13 @@ app.get('/api/filaments', async (req, res) => {
});
app.post('/api/filaments', authenticateToken, async (req, res) => {
const { brand, tip, finish, boja, boja_hex, refill, vakum, otvoreno, kolicina, cena } = req.body;
const { tip, finish, boja, boja_hex, refill, vakum, otvoreno, kolicina, cena } = req.body;
try {
const result = await pool.query(
`INSERT INTO filaments (brand, tip, finish, boja, boja_hex, refill, vakum, otvoreno, kolicina, cena)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING *`,
[brand, tip, finish, boja, boja_hex, refill, vakum, otvoreno, kolicina || 1, cena]
`INSERT INTO filaments (tip, finish, boja, boja_hex, refill, vakum, otvoreno, kolicina, cena)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING *`,
[tip, finish, boja, boja_hex, refill, vakum, otvoreno, kolicina || 1, cena]
);
res.json(result.rows[0]);
} catch (error) {
@@ -149,16 +149,16 @@ app.post('/api/filaments', authenticateToken, async (req, res) => {
app.put('/api/filaments/:id', authenticateToken, async (req, res) => {
const { id } = req.params;
const { brand, tip, finish, boja, boja_hex, refill, vakum, otvoreno, kolicina, cena } = req.body;
const { tip, finish, boja, boja_hex, refill, vakum, otvoreno, kolicina, cena } = req.body;
try {
const result = await pool.query(
`UPDATE filaments
SET brand = $1, tip = $2, finish = $3, boja = $4, boja_hex = $5,
refill = $6, vakum = $7, otvoreno = $8, kolicina = $9, cena = $10,
SET tip = $1, finish = $2, boja = $3, boja_hex = $4,
refill = $5, vakum = $6, otvoreno = $7, kolicina = $8, cena = $9,
updated_at = CURRENT_TIMESTAMP
WHERE id = $11 RETURNING *`,
[brand, tip, finish, boja, boja_hex, refill, vakum, otvoreno, kolicina || 1, cena, id]
WHERE id = $10 RETURNING *`,
[tip, finish, boja, boja_hex, refill, vakum, otvoreno, kolicina || 1, cena, id]
);
res.json(result.rows[0]);
} catch (error) {