Skip to content

Conversation

@jojos003
Copy link

@jojos003 jojos003 commented Oct 6, 2025

No description provided.

Copy link
Owner

@adaedra adaedra left a comment

Choose a reason for hiding this comment

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

Very nice

Comment on lines +18 to +23
in 500, { error: message }
Result::Failure.new(Array(message))
in 500, { errors: messages }
Result::Failure.new(Array(messages))
in 500, message
Result::Failure.new(Array(message))
Copy link
Owner

Choose a reason for hiding this comment

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

Nice use of Array(...)

Copy link
Author

@jojos003 jojos003 Oct 6, 2025

Choose a reason for hiding this comment

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

Je trouve ça redondant de devoir refaire sans arrêt Result::Failure.new(Array(message))

Copy link
Owner

Choose a reason for hiding this comment

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

Ouais, malheureusement, sans la possibilité de faire des alternate avec assignation, c'est bloqué comme ça

Ce serait effectivement cool de juste

in 500, { error: messages } | { errors: messages } | String => messages
  Result::Failure.new(Array(messages))

Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

" il y a presque 5 ans " bon bah c'est pas près d'être possible 😄

Result::Failure.new([])
in 200, {}
Result::Success.new(nil)
in 200, { payload: { **payload } }
Copy link
Owner

Choose a reason for hiding this comment

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

Je pense que tu peux simplement utiliser

Suggested change
in 200, { payload: { **payload } }
in 200, { payload: }

Copy link
Author

Choose a reason for hiding this comment

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

effectivement, pas mal comme ça !

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