Skip to content

MC-1698: adding REST endpoint to admin corpus api for rejecting & unscheduling approved items for a domain #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 1, 2025

Conversation

katerinachinnappan
Copy link
Collaborator

@katerinachinnappan katerinachinnappan commented Mar 31, 2025

Goal

There has been a request to delete several approved corpus items and all related scheduled items for a domain.

Added a POST REST endpoint to the admin curated corpus api: /admin/reject-approved-corpus-items-for-domain:
* takes in two params: domainName & testing
* if testing=false, approved items for the domain are rejected/unscheduled
* if testing=true, the count of approved items found for the domain is returned
* Example request body:
{ "domainName": "elpais.com", "testing": false }

  • Added the new REST endpoint in admin/routes
  • Created a new function/mutation rejectApprovedCorpusItemsForDomain which takes in a domainName &:
    • finds all approved items for the domain
    • finds all scheduled items for the approved item
      • unschedules each item
    • rejects the approved corpus items

User must have FULL access to execute this endpoint.

Deployment steps

  • Deployed to dev

References

JIRA ticket:

@github-actions github-actions bot deployed to collection-api-dev March 31, 2025 19:43 Active
@github-actions github-actions bot deployed to curated-corpus-api-dev March 31, 2025 19:43 Active
@github-actions github-actions bot deployed to prospect-api-dev March 31, 2025 19:44 Active
jpetto
jpetto previously approved these changes Mar 31, 2025
Copy link
Contributor

@jpetto jpetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small improvement you could make, but not critical given the time frame.

Copy link
Contributor

@jpetto jpetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more verification in a test for removing the scheduled item, but otherwise this is looking good!

@katerinachinnappan katerinachinnappan merged commit 84c0730 into main Apr 1, 2025
13 checks passed
@katerinachinnappan katerinachinnappan deleted the katerina/MC-1698-bulk-reject-rest-endpoint branch April 1, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants