(ctx context.Context, rc requestContext)
| 12 | ) |
| 13 | |
| 14 | func handleNotificationProfileCreate(ctx context.Context, rc requestContext) (any, *apiError) { |
| 15 | var cfg notifyprofile.Config |
| 16 | |
| 17 | if err := json.Unmarshal(rc.body, &cfg); err != nil { |
| 18 | return nil, requestError(serverapi.ErrorMalformedRequest, "malformed request body: "+string(rc.body)) |
| 19 | } |
| 20 | |
| 21 | if err := repo.WriteSession(ctx, rc.rep, repo.WriteSessionOptions{ |
| 22 | Purpose: "NotificationProfileCreate", |
| 23 | }, func(ctx context.Context, w repo.RepositoryWriter) error { |
| 24 | return notifyprofile.SaveProfile(ctx, w, cfg) |
| 25 | }); err != nil { |
| 26 | return nil, internalServerError(err) |
| 27 | } |
| 28 | |
| 29 | return &serverapi.Empty{}, nil |
| 30 | } |
| 31 | |
| 32 | func handleNotificationProfileTest(ctx context.Context, rc requestContext) (any, *apiError) { |
| 33 | var cfg notifyprofile.Config |
nothing calls this directly
no test coverage detected