Move no cars found so logs can be read
All checks were successful
Build, Push and Run Container / build (push) Successful in 24s
All checks were successful
Build, Push and Run Container / build (push) Successful in 24s
This commit is contained in:
@@ -254,8 +254,6 @@ if (app.Environment.IsDevelopment())
|
|||||||
string[] vins = vehiclesEnvelope?.Response.Select(x => x.Vin ?? "").Where(v => !String.IsNullOrWhiteSpace(v)).ToArray() ?? Array.Empty<string>();
|
string[] vins = vehiclesEnvelope?.Response.Select(x => x.Vin ?? "").Where(v => !String.IsNullOrWhiteSpace(v)).ToArray() ?? Array.Empty<string>();
|
||||||
logger.LogCritical("User has access to {count} cars: {vins}", vins.Length, String.Join(", ", vins));
|
logger.LogCritical("User has access to {count} cars: {vins}", vins.Length, String.Join(", ", vins));
|
||||||
|
|
||||||
if (vins.Length == 0)
|
|
||||||
return Results.Ok("No cars found");
|
|
||||||
|
|
||||||
//Get CA from validate server file
|
//Get CA from validate server file
|
||||||
string fileContent = await File.ReadAllTextAsync("Resources/validate_server.json");
|
string fileContent = await File.ReadAllTextAsync("Resources/validate_server.json");
|
||||||
@@ -281,6 +279,9 @@ if (app.Environment.IsDevelopment())
|
|||||||
};
|
};
|
||||||
logger.LogInformation("Config request: {configRequest}", JsonSerializer.Serialize(configRequest, new JsonSerializerOptions() { WriteIndented = true }));
|
logger.LogInformation("Config request: {configRequest}", JsonSerializer.Serialize(configRequest, new JsonSerializerOptions() { WriteIndented = true }));
|
||||||
|
|
||||||
|
if (vins.Length == 0)
|
||||||
|
return Results.Ok("No cars found");
|
||||||
|
|
||||||
client.BaseAddress = new Uri("https://fleet-api.prd.eu.vn.cloud.tesla.com");
|
client.BaseAddress = new Uri("https://fleet-api.prd.eu.vn.cloud.tesla.com");
|
||||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {access_token}");
|
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {access_token}");
|
||||||
client.DefaultRequestHeaders.Add("X-Tesla-User-Agent", "Tesla-Connector/1.0.0");
|
client.DefaultRequestHeaders.Add("X-Tesla-User-Agent", "Tesla-Connector/1.0.0");
|
||||||
|
|||||||
Reference in New Issue
Block a user