Skip to content

Commit

Permalink
Removed Deprecated for DeletePartials
Browse files Browse the repository at this point in the history
  • Loading branch information
developerkunal committed Sep 2, 2024
1 parent 8a4a05f commit 5c92d64
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions management/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,13 @@ func (m *PromptManager) ReadPartials(ctx context.Context, prompt PromptType, opt

// DeletePartials deletes custom prompt partials for a given segment.
//
// Deprecated: Use [ SetPartials ] with an empty [PromptScreenPartials] struct instead. The [ SetPartials ] method now handles deletion as well.
//
// See: https://auth0.com/docs/sign-up-prompt-customizations#use-the-api-to-edit-custom-prompts
func (m *PromptManager) DeletePartials(ctx context.Context, prompt PromptType, opts ...RequestOption) error {
if err := guardAgainstPromptTypesWithNoPartials(prompt); err != nil {
return err
}

return m.management.Request(ctx, "PUT", m.management.URI("prompts", string(prompt), "partials"), &PromptPartials{Prompt: prompt}, opts...)
return m.management.Request(ctx, "PUT", m.management.URI("prompts", string(prompt), "partials"), &PromptScreenPartials{}, opts...)
}

func guardAgainstPromptTypesWithNoPartials(prompt PromptType) error {
Expand Down

0 comments on commit 5c92d64

Please sign in to comment.