CenterForDigitalHumanities / TPEN-services

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

WIP on Issue #93 #103

Closed leandrumartin closed 4 months ago

leandrumartin commented 4 months ago

Added /project/create route to add Projects to local Mongo database, and implemented the basic logic for it. I also added a test for that logic (test with npm run unitTests.

leandrumartin commented 4 months ago

Otherwise this looks good, just noting that trouble about being able to GET a project. Within your scope is the ability to GET a project that was created.

@thehabes The GET route is requiring that the project ID be a number, but the IDs autogenerated by Mongo contain letters. Should we simply remove the number requirement?

thehabes commented 4 months ago

@leandrumartin Correct. The "id" you are expecting is conformant with MongoDB. This means you are no longer expecting an integer. You are expecting a "hexidecimal string" aka "string" that contains letters and numbers.

Outside of your scope, we are working on a shared isValid() for this new id pattern. We might merge that in today. For now, all you can assume about how to validate yours is that "it is a string". You can either remove the validation calls in your code, or replace the logic of your "isValid()" with return true