mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Addressing review comments
This commit is contained in:
@@ -60,6 +60,8 @@ func (m *mock) UpdateApp(ctx context.Context, app *models.App) (*models.App, err
|
||||
}
|
||||
|
||||
func (m *mock) RemoveApp(ctx context.Context, appName string) error {
|
||||
m.batchDeleteCalls(ctx, appName)
|
||||
m.batchDeleteRoutes(ctx, appName)
|
||||
for i, a := range m.Apps {
|
||||
if a.Name == appName {
|
||||
m.Apps = append(m.Apps[:i], m.Apps[i+1:]...)
|
||||
@@ -157,7 +159,7 @@ func (m *mock) GetCalls(ctx context.Context, filter *models.CallFilter) ([]*mode
|
||||
return m.Calls, nil
|
||||
}
|
||||
|
||||
func (m *mock) BatchDeleteCalls(ctx context.Context, appName string) error {
|
||||
func (m *mock) batchDeleteCalls(ctx context.Context, appName string) error {
|
||||
newCalls := []*models.Call{}
|
||||
for _, c := range m.Calls {
|
||||
if c.AppName != appName {
|
||||
@@ -168,7 +170,7 @@ func (m *mock) BatchDeleteCalls(ctx context.Context, appName string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *mock) BatchDeleteRoutes(ctx context.Context, appName string) error {
|
||||
func (m *mock) batchDeleteRoutes(ctx context.Context, appName string) error {
|
||||
newRoutes := []*models.Route{}
|
||||
for _, c := range m.Routes {
|
||||
if c.AppName != appName {
|
||||
|
||||
Reference in New Issue
Block a user