Skip to content
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

feat(API): delete admin-license candidate #2298

Merged

Conversation

dushimsam
Copy link
Contributor

@dushimsam dushimsam commented Aug 22, 2022

Signed-off-by: dushimsam dushsam@gmail.com

Description

An endpoint to delete admin-license candidate.

Changes

  1. Added a new controller file and the function to handle the logic in LicenseController.
  2. Updated the file AdminLicenseCandidate.php to be reusable by the outside callers.
  3. Updated the main file(index.php) by adding a new route DELETE /license/candidates/{id}.
  4. Updated the openapi.yaml file to introduce a new API.

How to test

Make a DELETE request on the endpoint accessed at "/license/candidates/{id}"

Example

1. FIRST CASE

In this case, the Admin-license-candidate exists, and the license-candidate will be deleted successfully.

license_candidate_delete

2. SECOND CASE

In this case, the Admin-license-candidate doesn't exist, so 404 error will be returned instead.

license_candidate_delete_2

3. THIRD CASE

The request is not coming from the Admin.
This request can only be run by the admin , else the request will fail returning 400 ERROR.

not_admin

Related Issue:

Fixes #2297

cc: @shaheemazmalmmd @GMishx

@shaheemazmalmmd shaheemazmalmmd added needs code review needs test GSoC-22 Label to tag issues and pull request for GSOC 2022 activities labels Aug 23, 2022
@github-actions github-actions bot added the has merge conflicts PR to be rebased label Sep 5, 2022
@github-actions
Copy link

github-actions bot commented Sep 5, 2022

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

@dushimsam dushimsam force-pushed the dushimsam/feat/delete-license-candidate branch from 9c8381d to e2966d8 Compare September 5, 2022 09:04
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Sep 5, 2022
@dushimsam dushimsam force-pushed the dushimsam/feat/delete-license-candidate branch 2 times, most recently from e0d2b9e to 5dc7231 Compare September 6, 2022 20:57
@GMishx GMishx added this to the 4.3.0 milestone Nov 9, 2022
@github-actions github-actions bot added the has merge conflicts PR to be rebased label Feb 27, 2023
@github-actions
Copy link

This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request.

@GMishx GMishx force-pushed the dushimsam/feat/delete-license-candidate branch from 5dc7231 to d91acd0 Compare February 28, 2023 11:09
@github-actions github-actions bot removed the has merge conflicts PR to be rebased label Feb 28, 2023
@GMishx GMishx force-pushed the dushimsam/feat/delete-license-candidate branch from d91acd0 to 22f9e48 Compare February 28, 2023 11:11
Copy link
Member

@GMishx GMishx left a comment

Choose a reason for hiding this comment

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

Changes looks good.
Tested, working as expected.

Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
@GMishx GMishx force-pushed the dushimsam/feat/delete-license-candidate branch from 22f9e48 to 644879d Compare February 28, 2023 11:21
@GMishx GMishx merged commit 2f704d6 into fossology:master Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GSoC-22 Label to tag issues and pull request for GSOC 2022 activities ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete license Candidate
3 participants