Remove comment and fix bags

This commit is contained in:
––AsTroLog 2023-11-18 16:06:13 +00:00
parent b1ac3b5f3c
commit 06e813c038
3 changed files with 2 additions and 88 deletions

View File

@ -11,11 +11,6 @@
public string CreatedById { get; set; }
public Messages()
{
}
}

View File

@ -13,11 +13,11 @@ public partial class Chat : ComponentBase
[Inject]
private ApiClient _apiClient { get; set; }
[Inject]
[Inject]
private NavigationManager Navigation { get; set; }
public List<Messages> Messages { get; set; }
public List<String> Suggestion { get; set; } = new List<String>();
public List<String> Suggestion { get; set; } = new List<String>();
public Messages Message { get; set; }
@ -93,63 +93,6 @@ public partial class Chat : ComponentBase
}catch(Exception ex){
Console.WriteLine($"Error : {ex.Message}");
}
/*
try{
pageNumber = 0;
do{
pageNumber++;
request = new GraphQLRequest
{
Query = @"query MessagesPageFromPersonalWishlist($wishlistId: String!, $pageNumber: Int!, $pageSize: Int!) {
messagesPageFromPersonalWishlist( wishlistId: $wishlistId, pageNumber: $pageNumber, pageSize: $pageSize)
{
items {
id
text
role
createdById
}
totalPages
}
}",
Variables = new
{
wishlistId,
pageNumber,
pageSize = 1
}
};
response = await _apiClient.QueryAsync(request);
responseData = response.Data;
var jsonCategoriesResponse = JsonConvert.SerializeObject(responseData.messagesPageFromPersonalWishlist.items);
if(pageNumber == 1){
Messages = JsonConvert.DeserializeObject<List<Messages>>(jsonCategoriesResponse);
}else{
Message = JsonConvert.DeserializeObject<List<Messages>>(jsonCategoriesResponse);
Messages.InsertRange(0, Message);
}
// Messages.Reverse();
totalPages = responseData.messagesPageFromPersonalWishlist.totalPages;
isLoading = false;
StateHasChanged();
}while(pageNumber<totalPages);
}catch (Exception ex)
{
// Log the exception
Console.WriteLine($"An error occurred: {ex.Message}");
}
*/
}
private async Task AddNewMessage()
{

View File

@ -65,30 +65,6 @@ namespace ShoppingAssistantWebClient.Web.Pages
string wishlistId1 = chatId;
var text = inputValue;
/*
inputValue="";
request = new GraphQLRequest
{
Query = @"mutation AddMessageToPersonalWishlist($wishlistId: String!, $text: String!) {
addMessageToPersonalWishlist(wishlistId: $wishlistId, dto: { text: $text }) {
id
text
role
createdById
}
}
",
Variables = new
{
wishlistId =chatId,
text
}
};
await _apiClient.QueryAsync(request);
*/
cancelTokenSource = new CancellationTokenSource();
var cancellationToken = cancelTokenSource.Token;