Updated Endpoint Logic: Refactored the GET /line/{id} endpoint in the index.js file and also updated the line.mjs file.
Database Abstraction: Introduced a database controller abstraction with db.getByID() and db.find({property: match}) methods, simulating the connection to an actual database.
Alternate Returns for Query Parameters: Implemented logic to handle query parameters such as ?text=blob, ?image=full, ?image=line, and ?lookup=project mentioned in the issue.
Functionality unit tests : Implemented the tests to ensure the different query parameters are working fine.
Database Mock: Created a simple database mock (db.js) to simulate database interactions for testing purposes.
What was changed?
Updated Endpoint Logic: Refactored the GET /line/{id} endpoint in the index.js file and also updated the line.mjs file.
Database Abstraction: Introduced a database controller abstraction with db.getByID() and db.find({property: match}) methods, simulating the connection to an actual database.
Alternate Returns for Query Parameters: Implemented logic to handle query parameters such as ?text=blob, ?image=full, ?image=line, and ?lookup=project mentioned in the issue.
Functionality unit tests : Implemented the tests to ensure the different query parameters are working fine.
Database Mock: Created a simple database mock (db.js) to simulate database interactions for testing purposes.