tnc-ca-geo / animl-api

Backend for https://animl.camera
4 stars 0 forks source link

TypeScript: Models(Batch) #208

Closed alukach closed 1 week ago

alukach commented 2 weeks ago

What I'm changing

How I did it

Involves the usual changes needed for a model:

To get typechecking to pass, we needed to update the CloseUploadInput GQL type. Currently, it has parts property being an array of possibly null values:

https://github.com/tnc-ca-geo/animl-api/blob/90c9640b9c947244cf353ef737f1f59c62c0ab1d/src/api/type-defs/inputs/CloseUploadInput.ts#L7-L10

However, this caused problems when providing those parts to AWS SDK as the parts must not be null:

https://github.com/tnc-ca-geo/animl-api/blob/90c9640b9c947244cf353ef737f1f59c62c0ab1d/src/api/db/models/Batch.js#L198-L206

How you can test it


Relates to #187