mirror of
https://github.com/Shchoholiev/shopping-assistant-web-client.git
synced 2025-04-04 16:49:36 +00:00
Remove comment and fix bags
This commit is contained in:
parent
b1ac3b5f3c
commit
06e813c038
@ -11,11 +11,6 @@
|
||||
|
||||
public string CreatedById { get; set; }
|
||||
|
||||
|
||||
public Messages()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user