James!!
James!!
Explore posts from servers
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
Have to add iformfile, then turn of anti-forgery and then have to configure a startup.cs
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
Now I have to fix it
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
@Sehra @Keswiik Ig I have got the problem
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
good idea!
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
yep, i will do
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
by the browser ig
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
naah bro, that's auto generated
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
currently the post request, not sure about the get request yet cuz it will be emplty anyways
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
currently im struggling with the /api/contracts/upload endpoint
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
i also tested with a basic endpoint as well
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
yep i did
22 replies
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
// Endpoints
app.MapPost("/api/contracts/upload", async (
HttpContext context,
PdfService pdfService,
ContractAnalysisService analysisService,
DatabaseService dbService) =>
{
try
{
var file = context.Request.Form.Files[0];
if (file == null || file.Length == 0)
return Results.BadRequest("No file uploaded");

var text = await pdfService.ExtractTextFromPdf(file);
var contractInfo = await analysisService.AnalyzeContract(text);
await dbService.SaveContract(contractInfo);

return Results.Ok(contractInfo);
}
catch (Exception ex)
{
return Results.Problem(ex.Message);
}
});

app.MapGet("/api/contracts/{id}", async (
string id,
DatabaseService dbService) =>
{
try
{
var contract = await dbService.GetContract(id);
return contract != null ? Results.Ok(contract) : Results.NotFound();
}
catch (Exception ex)
{
return Results.Problem(ex.Message);
}
});

app.Run();
// Endpoints
app.MapPost("/api/contracts/upload", async (
HttpContext context,
PdfService pdfService,
ContractAnalysisService analysisService,
DatabaseService dbService) =>
{
try
{
var file = context.Request.Form.Files[0];
if (file == null || file.Length == 0)
return Results.BadRequest("No file uploaded");

var text = await pdfService.ExtractTextFromPdf(file);
var contractInfo = await analysisService.AnalyzeContract(text);
await dbService.SaveContract(contractInfo);

return Results.Ok(contractInfo);
}
catch (Exception ex)
{
return Results.Problem(ex.Message);
}
});

app.MapGet("/api/contracts/{id}", async (
string id,
DatabaseService dbService) =>
{
try
{
var contract = await dbService.GetContract(id);
return contract != null ? Results.Ok(contract) : Results.NotFound();
}
catch (Exception ex)
{
return Results.Problem(ex.Message);
}
});

app.Run();
22 replies
XXata
Created by James!! on 7/16/2024 in #help
Xata pull issue
understood, thanks again for for the response
10 replies
XXata
Created by James!! on 7/16/2024 in #help
Xata pull issue
No description
10 replies
XXata
Created by James!! on 7/16/2024 in #help
Xata pull issue
@kostas silly question but do i need to keep this xata generated schema, or it's just a modified reference of my original schema which i should keep?
10 replies
XXata
Created by James!! on 7/16/2024 in #help
Xata pull issue
got it, thanks @kostas!!!
10 replies
XXata
Created by James!! on 7/16/2024 in #help
Xata pull issue
how can i pull schema changes without the xata client?
10 replies