Skip to content

Add polling endpoint #74

@jatinkatyal13

Description

@jatinkatyal13

We need to create an endpoint where user can poll for the submissions that were made using polling mode. All the jobs are stored in the src/models/Submission model which has a result key. While polling the user will give us the submission id and we'll return the submission object

  • create a new folder src/routes/api/submissions
    • create an index.ts file which'll act as the url map
    • create an controller.ts file which'll export an object containing the handler
    • mount /api/submissions/:id endpoint to the polling controller
  • write test for the api
    • Test if the API fives 403 if the api key is not provided or incorrect
    • Test if the API gives 404 if submission id not found
    • Test if the API gives returns the serialized submission model
    • update the test here and here

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions