Changed stuff, added filter for statistics module
This commit is contained in:
parent
4a91ae2bf9
commit
fe87374e47
251 changed files with 3295 additions and 1705 deletions
|
|
@ -25,17 +25,33 @@ const server = serve({
|
|||
const path = `src/GarageApp/locales/${lng}/translation.json`
|
||||
return new Response(Bun.file(path))
|
||||
},
|
||||
"/GarageApp/api/vehicles": async req => {
|
||||
const uid = "39e9009e-50e1-4277-bbf7-69e5e0f6c6dc"
|
||||
"/GarageApp/api/vehicles/:uid": async req => {
|
||||
//const uid = "39e9009e-50e1-4277-bbf7-69e5e0f6c6dc"
|
||||
const uid = req.params.uid;
|
||||
const query = db.query(
|
||||
`SELECT * FROM vehicles WHERE id IN (SELECT vehicle_id FROM user_vehicles WHERE user_id='${uid}');`
|
||||
);
|
||||
// console.log(query.toString())
|
||||
const vehicles = query.all();
|
||||
// console.log(vehicles);
|
||||
return Response.json(vehicles)
|
||||
},
|
||||
|
||||
"/GarageApp/api/expenses/:uid": async req => {
|
||||
const uid = req.params.uid;
|
||||
const query = db.query(
|
||||
`SELECT * FROM expenses WHERE user_id='${uid}';`
|
||||
);
|
||||
const expenses = query.all();
|
||||
return Response.json(expenses)
|
||||
},
|
||||
|
||||
"/GarageApp/api/fillups/:uid": async req => {
|
||||
const uid = req.params.uid;
|
||||
const query = db.query(
|
||||
`SELECT * FROM fillups WHERE user_id='${uid}';`
|
||||
);
|
||||
const fillups = query.all();
|
||||
return Response.json(fillups)
|
||||
},
|
||||
|
||||
|
||||
"/api/hello": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue