Skip to content

Proposition Jonathan - #3

Open
jojos003 wants to merge 1 commit into
adaedra:mainfrom
jojos003:jonathan
Open

Proposition Jonathan#3
jojos003 wants to merge 1 commit into
adaedra:mainfrom
jojos003:jonathan

Conversation

@jojos003

@jojos003 jojos003 commented Oct 6, 2025

Copy link
Copy Markdown

No description provided.

@adaedra adaedra left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown
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(...)

@jojos003 jojos003 Oct 6, 2025

Copy link
Copy Markdown
Author

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
Copy Markdown
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
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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