I m getting an error
The assembly 'ProjectClient' does not contain a public invokable method with [JSInvokableAttribute("UpdateDealsStageAsync")].
in blazor wasm project
I have created the JSinvokable function
This is file DealService.cs
[JSInvokable("UpdateDealsStageAsync")]
public async Task<Deal> UpdateDealsStageAsync(int dealID, int stageID)
{
return await HttpClient.GetFromJsonAsync<Deal>($"{HttpClient.BaseAddress}api/deals/updatestage?dealid={dealID}&stageId={stageID}");
}
Site.js
window.dragdrop = () => {
$(function () {
$(".deal-card").draggable({ helper: 'clone', start: function () { $("#winlost").show(); }, });
$(".stage-container").droppable({
accept: ".deal-card",
drop: function (ev, ui) {
// $("#winlost").show();
var droppedItem = $(ui.draggable); //.clone()
var targetid = $(ev.target).attr('id');
var dealid = ui.draggable.attr('id');
$(ev.target).effect("highlight", {}, 3000);
DotNet.invokeMethodAsync('CRM.Client', 'UpdateDealsStageAsync', targetid, dealid)
.then(data => {
console.log(data);
});
$(this).append(droppedItem);
}
});
});
}
on drag, I need to call the JsInvokable Method But I m getting errors. and How do I pass the parameters too?