Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SylveonDeko committed Aug 3, 2024
1 parent f46c3f5 commit f2189e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
19 changes: 4 additions & 15 deletions src/Mewdeko/Controllers/PermissionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public async Task<IActionResult> AddDpo(ulong guildId, [FromBody] DpoRequest req
if (!com.IsSuccess)
return BadRequest(com);
var perms = (GuildPermission)request.Permissions;
await dpoService.AddOverride(guildId, request.Command, perms);
return Ok(dpoService);
var over = await dpoService.AddOverride(guildId, request.Command, perms);
return Ok(over);
}

/// <summary>
Expand All @@ -48,8 +48,8 @@ public async Task<IActionResult> AddDpo(ulong guildId, [FromBody] DpoRequest req
/// <param name="guildId"></param>
/// <param name="commandName"></param>
/// <returns></returns>
[HttpDelete("dpo/{guildId}/{commandName}")]
public async Task<IActionResult> RemoveDpo(ulong guildId, string commandName)
[HttpDelete("dpo/{guildId}")]
public async Task<IActionResult> RemoveDpo(ulong guildId, [FromBody] string commandName)
{
var com = cmdServ.Search(commandName);
if (!com.IsSuccess)
Expand All @@ -70,17 +70,6 @@ public async Task<IActionResult> GetPermissionsForGuildAsync(ulong guildId)
return Ok(perms);
}

/// <summary>
/// E
/// </summary>
public class Stupidity
{
/// <summary>
/// E
/// </summary>
public string Command { get; set; }
}

/// <summary>
/// E
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public static Task<PreconditionResult> ExecuteOverrides(ICommandContext ctx, Com
/// <param name="commandName">The name of the command.</param>
/// <param name="perm">The permission to override with.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
public async Task AddOverride(ulong guildId, string commandName, GuildPermission perm)
public async Task<DiscordPermOverride> AddOverride(ulong guildId, string commandName, GuildPermission perm)
{
commandName = commandName.ToLowerInvariant();

Expand All @@ -170,6 +170,7 @@ public async Task AddOverride(ulong guildId, string commandName, GuildPermission
overrides[(guildId, commandName)] = over;

await dbContext.SaveChangesAsync().ConfigureAwait(false);
return over;
}

/// <summary>
Expand Down

0 comments on commit f2189e7

Please sign in to comment.