@@ -372,20 +372,6 @@ func (r *mutationResolver) UpdateFramework(ctx context.Context, input types.Upda
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteFramework is the resolver for the deleteFramework field.
|
||||
func (r *mutationResolver) DeleteFramework(ctx context.Context, input types.DeleteFrameworkInput) (*types.DeleteFrameworkPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.FrameworkID.TenantID())
|
||||
|
||||
err := svc.Frameworks.Delete(ctx, input.FrameworkID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot delete framework: %w", err)
|
||||
}
|
||||
|
||||
return &types.DeleteFrameworkPayload{
|
||||
DeletedFrameworkID: input.FrameworkID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ImportFramework is the resolver for the importFramework field.
|
||||
func (r *mutationResolver) ImportFramework(ctx context.Context, input types.ImportFrameworkInput) (*types.ImportFrameworkPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.OrganizationID.TenantID())
|
||||
@@ -405,6 +391,20 @@ func (r *mutationResolver) ImportFramework(ctx context.Context, input types.Impo
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteFramework is the resolver for the deleteFramework field.
|
||||
func (r *mutationResolver) DeleteFramework(ctx context.Context, input types.DeleteFrameworkInput) (*types.DeleteFrameworkPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.FrameworkID.TenantID())
|
||||
|
||||
err := svc.Frameworks.Delete(ctx, input.FrameworkID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot delete framework: %w", err)
|
||||
}
|
||||
|
||||
return &types.DeleteFrameworkPayload{
|
||||
DeletedFrameworkID: input.FrameworkID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// // CreateMitigation is the resolver for the createMitigation field.
|
||||
func (r *mutationResolver) CreateMitigation(ctx context.Context, input types.CreateMitigationInput) (*types.CreateMitigationPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.OrganizationID.TenantID())
|
||||
|
||||
Reference in New Issue
Block a user