Open rajat1saxena opened 8 months ago
In the api project, create an endpoint to get total number of files associated with an API key.
api
Tech design:
In the apps/api/lib/media/routes.ts file, add the following route:
apps/api/lib/media/routes.ts
POST /get/count
The above will call the handler getMediaCount which will be created in the file apps/api/lib/media/handlers.ts.
getMediaCount
apps/api/lib/media/handlers.ts
The getMediaCount method will get the total count of the files associated with the apikey and return it.
Expected response:
{count: 500}
In the
api
project, create an endpoint to get total number of files associated with an API key.Tech design:
In the
apps/api/lib/media/routes.ts
file, add the following route:The above will call the handler
getMediaCount
which will be created in the fileapps/api/lib/media/handlers.ts
.The
getMediaCount
method will get the total count of the files associated with the apikey and return it.Expected response: