CenterForDigitalHumanities / TPEN-services

Services required by TPEN interfaces in order to interact with data
1 stars 0 forks source link

WIP on Issue 57 extend line web api #64

Closed BhanuKandula5030 closed 5 months ago

BhanuKandula5030 commented 6 months ago

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.