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

Fixed #13376 Component checkout via API returns error #13379

Merged

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Jul 28, 2023

Description

When checking out a component via API in the backend we where validating the asset_id variable instead of assigned_to, producing an error because it never validate as true.

Fixes #13376

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Test Configuration:

  • PHP version: 8.1
  • MySQL version: 8.0.31
  • Webserver version: PHP Dev Server
  • OS version: Debian 11

@what-the-diff
Copy link

what-the-diff bot commented Jul 28, 2023

PR Summary

  • Modification of Field in Components Validation
    The validation field in the ComponentsController.php file has been changed. Specifically, asset_id has been replaced with assigned_to. This update should lead to improvements in how the component assignments are validated within the system.

@snipe
Copy link
Owner

snipe commented Jul 28, 2023

Where is that field tho? On the components_assets table, I don't see an assigned_to field, only asset_id.

@inietov
Copy link
Collaborator Author

inietov commented Jul 28, 2023

In the docs we send the field in the API call as assigned_to
image

And in the code we map that field to asset_id after validate it
image

@snipe snipe merged commit 3e4b371 into snipe:develop Jul 31, 2023
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