Fixed deleted apigw status on save
Fixed bug that was overwriting deletedAt status in effect un-deleting the route.
This commit is contained in:
@@ -2,6 +2,7 @@ package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cortezaproject/corteza-server/pkg/apigw"
|
||||
"github.com/cortezaproject/corteza-server/pkg/errors"
|
||||
|
||||
@@ -119,16 +120,13 @@ func (svc *apigwRoute) Update(ctx context.Context, upd *types.ApigwRoute) (q *ty
|
||||
// return ApigwRouteErrExistsEndpoint(qProps)
|
||||
// }
|
||||
|
||||
upd.UpdatedAt = now()
|
||||
upd.CreatedAt = qq.CreatedAt
|
||||
upd.UpdatedBy = a.GetIdentityFromContext(ctx).Identity()
|
||||
qq.UpdatedAt = now()
|
||||
qq.UpdatedBy = a.GetIdentityFromContext(ctx).Identity()
|
||||
|
||||
if err = store.UpdateApigwRoute(ctx, svc.store, upd); err != nil {
|
||||
if err = store.UpdateApigwRoute(ctx, svc.store, qq); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
q = upd
|
||||
|
||||
ags := apigw.Service()
|
||||
|
||||
// If method or endpoint doesn't match then attach 404 handler
|
||||
@@ -146,7 +144,7 @@ func (svc *apigwRoute) Update(ctx context.Context, upd *types.ApigwRoute) (q *ty
|
||||
return nil
|
||||
}()
|
||||
|
||||
return q, svc.recordAction(ctx, qProps, ApigwRouteActionUpdate, err)
|
||||
return qq, svc.recordAction(ctx, qProps, ApigwRouteActionUpdate, err)
|
||||
}
|
||||
|
||||
func (svc *apigwRoute) DeleteByID(ctx context.Context, ID uint64) (err error) {
|
||||
|
||||
Reference in New Issue
Block a user