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

Add persists code samples for ballerina bff #3

Merged
merged 13 commits into from
Nov 28, 2023

Conversation

SasinduDilshara
Copy link
Contributor

Add code samples related to ballerina-persists module for ballerina backend to frontend(bff).

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
persists/backend_server/Ballerina.toml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
persists/backend_server/persist/model.bal Outdated Show resolved Hide resolved
};

// Example: http://localhost:9090/sales/orders
isolated resource function post orders(Order orderEntry) returns http:Ok|http:InternalServerError|http:BadRequest|error {

Choose a reason for hiding this comment

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

Why are we sending both http:InternalServerError and error here? My suggestion is to stick with one here and use that pattern for all resource functions.

Copy link
Contributor Author

@SasinduDilshara SasinduDilshara Nov 8, 2023

Choose a reason for hiding this comment

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

updated, Please check.
I think http:InternalServerError is the best option.
But, In the L14 and L34, those resource functions returns error to keep the simplicity.
Other resource functions returns http:InternalServerError.

persists/backend_server/server.bal Outdated Show resolved Hide resolved
persists/backend_server/server.bal Outdated Show resolved Hide resolved
sm1990
sm1990 previously approved these changes Nov 14, 2023
Copy link

@sameerajayasoma sameerajayasoma left a comment

Choose a reason for hiding this comment

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

Reviewed the Ballerina code

@anupama-pathirage anupama-pathirage merged commit 1464e20 into ballerina-guides:main Nov 28, 2023
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.

7 participants