Skip to content

Enhance the Audit Logs Endpoint #386

Open
@rootelement

Description

@rootelement

AuditLogs endpoint uses unpaginated Dynamo scan to get data, so it doesn't return everything.

I ran this:

curl --location --request GET 'https://api.topcoder-dev.com/v5/challenge-audit-logs?challengeId=6008631e-48e5-45d7-8025-2758374a7d9d' \
--header 'Authorization: Bearer [my jwt]' \
--header 'Content-Type: application/json' \
--data-raw ''

And get one object returned:

[
    {
        "challengeId": "6008631e-48e5-45d7-8025-2758374a7d9d",
        "newValue": "\"2021-02-22T11:06:31.000Z\"",
        "created": "2021-02-19T11:08:14.486Z",
        "memberId": "40029484",
        "fieldName": "endDate",
        "id": "5fabad53-5ff5-4f3c-bbce-bd945a917a7e",
        "createdBy": "jcori",
        "oldValue": "\"2021-03-24T15:06:31.000Z\""
    }
]

But in the UI, i get 14 rows returned:

Screen Shot 2021-02-19 at 11 38 20 AM

Update the endpoint to use better dynamo query logic (adding challenge id as a range key and fieldName as a hash key would probably be a good start)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions