Basaingeal / Razor.SweetAlert2

A Razor class library for interacting with SweetAlert2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: PreconfirmCallback cant perform http request?

glararan opened this issue · comments

Describe the bug
I would like to make http delete request withing preconfirm callback. However my call never make it to server and value is returned.

To Reproduce

SweetAlertResult result = await SweetAlert.FireAsync(new SweetAlertOptions
{
    Icon = SweetAlertIcon.Warning,
    ShowCancelButton = true,
    PreConfirm = new PreConfirmCallback(async() =>
    {
        try
        {
            await Http.DeleteAsync($"api/Product/{item.Id}");

            return "1";
        }
        catch
        {
            return "0";
        }
    })
});

Expected behavior
Wait till http delete make request then return "1".

Wrong request url. What a fail.