Skip to content

Commit

Permalink
add: new actoin api logic
Browse files Browse the repository at this point in the history
  • Loading branch information
alonkeyval committed Oct 22, 2024
1 parent f10f9a0 commit de8ac43
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
14 changes: 9 additions & 5 deletions frontend/graph/schema.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions frontend/services/actions/piimasking.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,19 @@ func CreatePiiMasking(ctx context.Context, action model.ActionInput) (model.Acti
return nil, fmt.Errorf("failed to create PiiMasking: %v", err)
}

piiCategories := make([]string, len(details.PiiCategories))
for i, category := range details.PiiCategories {
piiCategories[i] = string(category)
}

response := &model.PiiMaskingAction{
ID: generatedAction.Name,
Type: ActionTypePiiMasking,
Name: action.Name,
Notes: action.Notes,
Disable: action.Disable,
Signals: action.Signals,
Details: details.PiiCategories,
Details: piiCategories,
}

return response, nil
Expand Down Expand Up @@ -95,14 +100,19 @@ func UpdatePiiMasking(ctx context.Context, id string, action model.ActionInput)
return nil, fmt.Errorf("failed to update PiiMasking: %v", err)
}

piiCategories := make([]string, len(details.PiiCategories))
for i, category := range details.PiiCategories {
piiCategories[i] = string(category)
}

response := &model.PiiMaskingAction{
ID: updatedAction.Name,
Type: ActionTypePiiMasking,
Name: action.Name,
Notes: action.Notes,
Disable: action.Disable,
Signals: action.Signals,
Details: details.PiiCategories,
Details: piiCategories,
}

return response, nil
Expand Down

0 comments on commit de8ac43

Please sign in to comment.