Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chsami committed Nov 24, 2024
1 parent 0eefee2 commit 1cd0cdc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions MicrobotApi/Controllers/ScriptController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ namespace MicrobotApi.Controllers;

[ApiController]
[Route("api/[controller]")]
public class ScriptController(MicrobotContext microbotContext, IMemoryCache memoryCache, XataService xataService)
public class ScriptController(XataService xataService)
: Controller
{
private readonly XataService _xataService = xataService;

[HttpGet("{key}/{hwid}")]
/*[HttpGet("{key}/{hwid}")]
public async Task<IActionResult> List(string key, string hwid)
{
var exists = await microbotContext.Keys.AnyAsync(x => x.Key == key && (x.HWID == "" || x.HWID == hwid));
Expand All @@ -30,7 +30,7 @@ public async Task<IActionResult> List(string key, string hwid)
memoryCache.Set(key, DateTime.Now, cacheEntryOptions);
return Ok(scripts.Select(x => x.Id));
}
}*/


[HttpPost("runtime")]
Expand Down
10 changes: 7 additions & 3 deletions MicrobotApi/Program.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using Azure.Storage.Blobs;
using Discord.Commands;
using Discord.WebSocket;
using MicrobotApi;
using MicrobotApi.Database;
using MicrobotApi.Handlers;
using MicrobotApi.Services;
using Microsoft.AspNetCore.Authentication.OAuth;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.OpenApi.Models;
using Stripe;

Expand Down Expand Up @@ -81,7 +80,12 @@
{
client.BaseAddress = new Uri(builder.Configuration["Discord:Api"]);

Check warning on line 81 in MicrobotApi/Program.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'uriString' in 'Uri.Uri(string uriString)'.
});
/*builder.Services.AddSingleton<DiscordBotService>();
builder.Services.AddHostedService<BotHostedService>();*/
builder.Services.AddScoped<AzureStorageService>();
/*builder.Services.AddSingleton<DiscordSocketClient>();
builder.Services.AddSingleton<CommandService>();*/
builder.Services.AddScoped<XataService>();
builder.Services.AddSingleton(c =>
new BlobServiceClient(builder.Configuration.GetConnectionString("AzureBlobConnection"))
);
Expand Down

0 comments on commit 1cd0cdc

Please sign in to comment.