Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newsletter::newsletter_creation_is_idempotent at the end of 11.8 does not actually work #236

Open
rlpowell opened this issue Nov 25, 2023 · 0 comments

Comments

@rlpowell
Copy link

The test requires that the repeated response have a flash message, which is not in fact in the code; I had to add it like so:

    // Return early if we have a saved response in the database
    if let Some(saved_response) = get_saved_response(&pool, &idempotency_key, *user_id)
        .await
        .map_err(e500)?
    {
        FlashMessage::info("The newsletter issue has been published!").send();
        return Ok(saved_response);
    }

I believe this is the same method that https://github.com/LukeMathWalker/zero-to-production/blob/root-chapter-11/src/routes/admin/newsletter/post.rs#L50 uses later in the chapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant