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

Get rid of Option<Vec<_>> in api structs (fixes #2820) #5463

Merged
merged 5 commits into from
Feb 28, 2025

Conversation

Nutomic
Copy link
Member

@Nutomic Nutomic commented Feb 28, 2025

Api tests are failing with "unknown" even after updating js client, not sure whats the problem.

@dessalines
Copy link
Member

The error is most likely this, so an update, delete, or get_results returning zero results throwing an error: https://docs.diesel.rs/master/diesel/result/enum.Error.html#variant.NotFound

Also, I was only referring to removing optional from the responses. Forms that do create/update/delete operations should probably stay optional, otherwise the back-end might throw errors if they're missing. IE if you want to update a post, you shouldn't need to provide discussion languages if you aren't updating those.

@Nutomic
Copy link
Member Author

Nutomic commented Feb 28, 2025

Alright thats easier. There is also #[serde(default)] to make vec params optional but no need for that.

@dessalines dessalines enabled auto-merge (squash) February 28, 2025 13:44
@dessalines dessalines merged commit 3599422 into main Feb 28, 2025
2 checks passed
@SleeplessOne1917 SleeplessOne1917 deleted the api-no-optional-vec branch February 28, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants