-
Notifications
You must be signed in to change notification settings - Fork 210
Add the ability to delete application #1308
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
Conversation
pkg/app/api/grpcapi/web_api.go
Outdated
| if err := a.applicationStore.DeleteApplication(ctx, req.ApplicationId); err != nil { | ||
| switch err { | ||
| case datastore.ErrNotFound: | ||
| return nil, status.Error(codes.InvalidArgument, "The application is not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be codes.NotFound 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Thanks.
|
nits, should we validate the application is deleted or not before update it? |
|
Code coverage for golang is
|
|
@khanhtc1202 You are right. Added the missing validation. |
pkg/datastore/applicationstore.go
Outdated
| func (s *applicationStore) EnableApplication(ctx context.Context, id string) error { | ||
| return s.ds.Update(ctx, applicationModelKind, id, applicationFactory, func(e interface{}) error { | ||
| app := e.(*model.Application) | ||
| if app.Deleted == true { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, this is what you said.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops. This is not what I said. lol. Let me fix this.
What I said is what @khanhtc1202 mentioned at #1308 (comment)
|
Thank you |
|
Code coverage for golang is
|
|
I have another issue that needs opinions from you guys. |
|
@khanhtc1202 Yes. I prefer to filter the deleted ones at the server side (db level by updating the query). But currently, |
|
Code coverage for golang is
|
I see, thanks for clarifying the situation 🙏 |
|
Yes. That issue should be considered separately. |
|
Thanks 😊 |
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1289
Does this PR introduce a user-facing change?: